Skip to content

Latest commit

 

History

History
304 lines (217 loc) · 12.4 KB

README.md

File metadata and controls

304 lines (217 loc) · 12.4 KB

AppsV1

(appsV1())

Overview

Available Operations

createAppV1Deprecated

Create a new application.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreateAppV1DeprecatedResponse;
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();

        AppConfig req = AppConfig.builder()
                .appName("minecraft")
                .authConfiguration(AuthConfiguration.builder()
                    .build())
                .build();

        CreateAppV1DeprecatedResponse res = sdk.appsV1().createAppV1Deprecated()
                .request(req)
                .call();

        if (res.application().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request AppConfig ✔️ The request object to use for the request.

Response

CreateAppV1DeprecatedResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 422, 429, 500 application/json
models/errors/SDKError 4XX, 5XX */*

deleteAppV1Deprecated

Delete an application using appId. Your organization will lose access to this application.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.DeleteAppV1DeprecatedResponse;
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();

        DeleteAppV1DeprecatedResponse res = sdk.appsV1().deleteAppV1Deprecated()
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description Example
appId Optional<String> N/A app-af469a92-5b45-4565-b3c4-b79878de67d2

Response

DeleteAppV1DeprecatedResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429, 500 application/json
models/errors/SDKError 4XX, 5XX */*

getAppInfoV1Deprecated

Get details for an application using appId.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetAppInfoV1DeprecatedResponse;
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();

        GetAppInfoV1DeprecatedResponse res = sdk.appsV1().getAppInfoV1Deprecated()
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .call();

        if (res.application().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
appId Optional<String> N/A app-af469a92-5b45-4565-b3c4-b79878de67d2

Response

GetAppInfoV1DeprecatedResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getAppsV1Deprecated

Returns an unsorted list of your organization’s applications. An application is uniquely identified by an appId.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetAppsV1DeprecatedResponse;
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();

        GetAppsV1DeprecatedResponse res = sdk.appsV1().getAppsV1Deprecated()
                .call();

        if (res.classes().isPresent()) {
            // handle response
        }
    }
}

Response

GetAppsV1DeprecatedResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 429 application/json
models/errors/SDKError 4XX, 5XX */*

updateAppV1Deprecated

Update data for an existing application using appId.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.UpdateAppV1DeprecatedResponse;
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();

        UpdateAppV1DeprecatedResponse res = sdk.appsV1().updateAppV1Deprecated()
                .appConfig(AppConfig.builder()
                    .appName("minecraft")
                    .authConfiguration(AuthConfiguration.builder()
                        .build())
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .call();

        if (res.application().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
appConfig AppConfig ✔️ N/A
appId Optional<String> N/A app-af469a92-5b45-4565-b3c4-b79878de67d2

Response

UpdateAppV1DeprecatedResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 422, 429, 500 application/json
models/errors/SDKError 4XX, 5XX */*