(appsV2())
Operations that allow you manage your applications.
Create a new application.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreateAppResponse;
import dev.hathora.cloud_sdk.models.shared.AppConfig;
import dev.hathora.cloud_sdk.models.shared.AuthConfiguration;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
CreateAppResponse res = sdk.appsV2().createApp()
.appConfig(AppConfig.builder()
.appName("minecraft")
.authConfiguration(AuthConfiguration.builder()
.build())
.build())
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.call();
if (res.application().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
appConfig |
AppConfig |
✔️ |
N/A |
|
orgId |
Optional<String> |
➖ |
N/A |
org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
CreateAppResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 422, 429, 500 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Delete an application using appId
. Your organization will lose access to this application.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.DeleteAppResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
DeleteAppResponse res = sdk.appsV2().deleteApp()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
Example |
appId |
Optional<String> |
➖ |
N/A |
app-af469a92-5b45-4565-b3c4-b79878de67d2 |
DeleteAppResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 429, 500 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get details for an application using appId
.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetAppResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetAppResponse res = sdk.appsV2().getApp()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.call();
if (res.application().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
appId |
Optional<String> |
➖ |
N/A |
app-af469a92-5b45-4565-b3c4-b79878de67d2 |
GetAppResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 429 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Returns an unsorted list of your organization’s applications. An application is uniquely identified by an appId
.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetAppsResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetAppsResponse res = sdk.appsV2().getApps()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.call();
if (res.applicationsPage().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
orgId |
Optional<String> |
➖ |
N/A |
org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
GetAppsResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 429 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Update data for an existing application using appId
.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.UpdateAppResponse;
import dev.hathora.cloud_sdk.models.shared.AppConfig;
import dev.hathora.cloud_sdk.models.shared.AuthConfiguration;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
UpdateAppResponse res = sdk.appsV2().updateApp()
.appConfig(AppConfig.builder()
.appName("minecraft")
.authConfiguration(AuthConfiguration.builder()
.build())
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.call();
if (res.application().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
appConfig |
AppConfig |
✔️ |
N/A |
|
appId |
Optional<String> |
➖ |
N/A |
app-af469a92-5b45-4565-b3c4-b79878de67d2 |
UpdateAppResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 422, 429, 500 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |