Skip to content

Latest commit

 

History

History
310 lines (222 loc) · 16.1 KB

File metadata and controls

310 lines (222 loc) · 16.1 KB

BuildsV1

(buildsV1())

Overview

Available Operations

createBuildDeprecated

Creates a new build. Responds with a buildId that you must pass to RunBuild() to build the game server artifact. You can optionally pass in a buildTag to associate an external version with a build.

⚠️ 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.CreateBuildDeprecatedResponse;
import dev.hathora.cloud_sdk.models.shared.CreateBuildParams;
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()
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .security(Security.builder()
                    .hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
                    .build())
            .build();

        CreateBuildDeprecatedResponse res = sdk.buildsV1().createBuildDeprecated()
                .createBuildParams(CreateBuildParams.builder()
                    .buildTag("0.1.14-14c793")
                    .build())
                .call();

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

Parameters

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

Response

CreateBuildDeprecatedResponse

Errors

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

deleteBuildDeprecated

Delete a build. All associated metadata is deleted.

⚠️ 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.DeleteBuildDeprecatedResponse;
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()
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .security(Security.builder()
                    .hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
                    .build())
            .build();

        DeleteBuildDeprecatedResponse res = sdk.buildsV1().deleteBuildDeprecated()
                .buildId(1)
                .call();

        // handle response
    }
}

Parameters

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

Response

DeleteBuildDeprecatedResponse

Errors

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

getBuildInfoDeprecated

Get details for a build.

⚠️ 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.GetBuildInfoDeprecatedResponse;
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()
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .security(Security.builder()
                    .hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
                    .build())
            .build();

        GetBuildInfoDeprecatedResponse res = sdk.buildsV1().getBuildInfoDeprecated()
                .buildId(1)
                .call();

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

Parameters

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

Response

GetBuildInfoDeprecatedResponse

Errors

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

getBuildsDeprecated

Returns an array of builds for an 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.GetBuildsDeprecatedResponse;
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()
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .security(Security.builder()
                    .hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
                    .build())
            .build();

        GetBuildsDeprecatedResponse res = sdk.buildsV1().getBuildsDeprecated()
                .call();

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

Parameters

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

Response

GetBuildsDeprecatedResponse

Errors

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

runBuildDeprecated

Builds a game server artifact from a tarball you provide. Pass in the buildId generated from CreateBuild().

⚠️ 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.*;
import dev.hathora.cloud_sdk.models.shared.Security;
import dev.hathora.cloud_sdk.utils.Utils;
import java.io.FileInputStream;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .security(Security.builder()
                    .hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
                    .build())
            .build();

        RunBuildDeprecatedResponse res = sdk.buildsV1().runBuildDeprecated()
                .requestBody(RunBuildDeprecatedRequestBody.builder()
                    .file(File.builder()
                        .content(Utils.readBytesAndClose(new FileInputStream("example.file")))
                        .fileName("example.file")
                        .build())
                    .build())
                .buildId(1)
                .call();

    }
}

Parameters

Parameter Type Required Description Example
requestBody RunBuildDeprecatedRequestBody ✔️ N/A
appId Optional<String> N/A app-af469a92-5b45-4565-b3c4-b79878de67d2
buildId int ✔️ N/A 1

Response

RunBuildDeprecatedResponse

Errors

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