mirror of
https://github.com/appwrite/sdk-for-kotlin.git
synced 2026-06-06 19:27:33 +00:00
Add support for 1.7
This commit is contained in:
@@ -14,7 +14,7 @@ avatars.getBrowser(
|
||||
Browser.AVANT_BROWSER, // code
|
||||
0, // width (optional)
|
||||
0, // height (optional)
|
||||
0, // quality (optional)
|
||||
-1, // quality (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -14,7 +14,7 @@ avatars.getCreditCard(
|
||||
CreditCard.AMERICAN_EXPRESS, // code
|
||||
0, // width (optional)
|
||||
0, // height (optional)
|
||||
0, // quality (optional)
|
||||
-1, // quality (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -14,7 +14,7 @@ avatars.getFlag(
|
||||
Flag.AFGHANISTAN, // code
|
||||
0, // width (optional)
|
||||
0, // height (optional)
|
||||
0, // quality (optional)
|
||||
-1, // quality (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -4,8 +4,9 @@ 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
|
||||
.setSession("") // The user session to authenticate with
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
.setJWT("<YOUR_JWT>"); // Your secret JSON Web Token
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ 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
|
||||
.setKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ databases.createIndex(
|
||||
IndexType.KEY, // type
|
||||
listOf(), // attributes
|
||||
listOf(), // orders (optional)
|
||||
listOf(), // lengths (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ Client client = new Client()
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.createBuild(
|
||||
functions.createDuplicateDeployment(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
"<DEPLOYMENT_ID>", // deploymentId
|
||||
"<BUILD_ID>", // buildId (optional)
|
||||
@@ -0,0 +1,28 @@
|
||||
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.createTemplateDeployment(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
"<REPOSITORY>", // repository
|
||||
"<OWNER>", // owner
|
||||
"<ROOT_DIRECTORY>", // rootDirectory
|
||||
"<VERSION>", // version
|
||||
false, // activate (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -13,6 +13,7 @@ functions.createVariable(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
"<KEY>", // key
|
||||
"<VALUE>", // value
|
||||
false, // secret (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Functions;
|
||||
import io.appwrite.enums.VCSDeploymentType;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("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
|
||||
VCSDeploymentType.BRANCH, // type
|
||||
"<REFERENCE>", // reference
|
||||
false, // activate (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -28,10 +28,6 @@ functions.create(
|
||||
"<PROVIDER_BRANCH>", // providerBranch (optional)
|
||||
false, // providerSilentMode (optional)
|
||||
"<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional)
|
||||
"<TEMPLATE_REPOSITORY>", // templateRepository (optional)
|
||||
"<TEMPLATE_OWNER>", // templateOwner (optional)
|
||||
"<TEMPLATE_ROOT_DIRECTORY>", // templateRootDirectory (optional)
|
||||
"<TEMPLATE_VERSION>", // templateVersion (optional)
|
||||
"", // specification (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -12,6 +12,7 @@ Functions functions = new Functions(client);
|
||||
functions.getDeploymentDownload(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
"<DEPLOYMENT_ID>", // deploymentId
|
||||
DeploymentDownloadType.SOURCE, // type (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,7 +12,6 @@ Functions functions = new Functions(client);
|
||||
functions.listExecutions(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ Client client = new Client()
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.updateDeploymentBuild(
|
||||
functions.updateDeploymentStatus(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
"<DEPLOYMENT_ID>", // deploymentId
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
+1
-1
@@ -9,7 +9,7 @@ Client client = new Client()
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.updateDeployment(
|
||||
functions.updateFunctionDeployment(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
"<DEPLOYMENT_ID>", // deploymentId
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
@@ -14,6 +14,7 @@ functions.updateVariable(
|
||||
"<VARIABLE_ID>", // variableId
|
||||
"<KEY>", // key
|
||||
"<VALUE>", // value (optional)
|
||||
false, // secret (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
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
|
||||
false, // activate
|
||||
"<INSTALL_COMMAND>", // installCommand (optional)
|
||||
"<BUILD_COMMAND>", // buildCommand (optional)
|
||||
"<OUTPUT_DIRECTORY>", // outputDirectory (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
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.createTemplateDeployment(
|
||||
"<SITE_ID>", // siteId
|
||||
"<REPOSITORY>", // repository
|
||||
"<OWNER>", // owner
|
||||
"<ROOT_DIRECTORY>", // rootDirectory
|
||||
"<VERSION>", // version
|
||||
false, // activate (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
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
|
||||
"<KEY>", // key
|
||||
"<VALUE>", // value
|
||||
false, // secret (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Sites;
|
||||
import io.appwrite.enums.VCSDeploymentType;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("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
|
||||
VCSDeploymentType.BRANCH, // type
|
||||
"<REFERENCE>", // reference
|
||||
false, // activate (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Sites;
|
||||
import io.appwrite.enums.Framework;
|
||||
import io.appwrite.enums.BuildRuntime;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("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
|
||||
.ANALOG, // framework
|
||||
.NODE_14_5, // buildRuntime
|
||||
false, // enabled (optional)
|
||||
false, // logging (optional)
|
||||
1, // timeout (optional)
|
||||
"<INSTALL_COMMAND>", // installCommand (optional)
|
||||
"<BUILD_COMMAND>", // buildCommand (optional)
|
||||
"<OUTPUT_DIRECTORY>", // outputDirectory (optional)
|
||||
.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)
|
||||
"", // specification (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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.getDeploymentDownload(
|
||||
"<SITE_ID>", // siteId
|
||||
"<DEPLOYMENT_ID>", // deploymentId
|
||||
DeploymentDownloadType.SOURCE, // type (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
}));
|
||||
@@ -0,0 +1,24 @@
|
||||
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
|
||||
listOf(), // queries (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
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(new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
}));
|
||||
@@ -0,0 +1,23 @@
|
||||
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
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
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
|
||||
"<VALUE>", // value (optional)
|
||||
false, // secret (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Sites;
|
||||
import io.appwrite.enums.Framework;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("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
|
||||
.ANALOG, // framework
|
||||
false, // enabled (optional)
|
||||
false, // logging (optional)
|
||||
1, // timeout (optional)
|
||||
"<INSTALL_COMMAND>", // installCommand (optional)
|
||||
"<BUILD_COMMAND>", // buildCommand (optional)
|
||||
"<OUTPUT_DIRECTORY>", // outputDirectory (optional)
|
||||
.NODE_14_5, // buildRuntime (optional)
|
||||
.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)
|
||||
"", // specification (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -12,6 +12,7 @@ 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();
|
||||
|
||||
@@ -15,7 +15,7 @@ storage.getFilePreview(
|
||||
0, // width (optional)
|
||||
0, // height (optional)
|
||||
ImageGravity.CENTER, // gravity (optional)
|
||||
0, // quality (optional)
|
||||
-1, // quality (optional)
|
||||
0, // borderWidth (optional)
|
||||
"", // borderColor (optional)
|
||||
0, // borderRadius (optional)
|
||||
@@ -23,6 +23,7 @@ storage.getFilePreview(
|
||||
-360, // rotation (optional)
|
||||
"", // background (optional)
|
||||
ImageFormat.JPG, // output (optional)
|
||||
"<TOKEN>", // token (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ 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();
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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
|
||||
"", // expire (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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
|
||||
listOf(), // queries (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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
|
||||
"", // expire (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -11,6 +11,8 @@ Users users = new Users(client);
|
||||
|
||||
users.listMemberships(
|
||||
"<USER_ID>", // userId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user