Skip to content

Latest commit

 

History

History
402 lines (264 loc) · 20.1 KB

README.md

File metadata and controls

402 lines (264 loc) · 20.1 KB

RoomsV2

(RoomsV2)

Overview

Available Operations

CreateRoom

Create a new room for an existing application. Poll the GetConnectionInfo() endpoint to get connection details for an active room.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;
using System.Collections.Generic;

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

CreateRoomRequest req = new CreateRoomRequest() {
    CreateRoomParams = new CreateRoomParams() {
        Region = Region.SaoPaulo,
        RoomConfig = "{\"name\":\"my-room\"}",
    },
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.RoomsV2.CreateRoomAsync(req))
{
    // handle response
}

Parameters

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

Response

CreateRoomResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 400,401,402,404,422,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

DestroyRoom

Destroy a room. All associated metadata is deleted.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

DestroyRoomRequest req = new DestroyRoomRequest() {
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.RoomsV2.DestroyRoomAsync(req))
{
    // handle response
}

Parameters

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

Response

DestroyRoomResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401,404,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

GetActiveRoomsForProcess

Get all active rooms for a given process.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

GetActiveRoomsForProcessRequest req = new GetActiveRoomsForProcessRequest() {
    ProcessId = "cbfcddd2-0006-43ae-996c-995fff7bed2e",
};


using(var res = await sdk.RoomsV2.GetActiveRoomsForProcessAsync(req))
{
    // handle response
}

Parameters

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

Response

GetActiveRoomsForProcessResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401,404,429 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

GetConnectionInfo

Poll this endpoint to get connection details to a room. Clients can call this endpoint without authentication.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

GetConnectionInfoRequest req = new GetConnectionInfoRequest() {
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.RoomsV2.GetConnectionInfoAsync(req))
{
    // handle response
}

Parameters

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

Response

GetConnectionInfoResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 400,402,404,422,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

GetInactiveRoomsForProcess

Get all inactive rooms for a given process.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

GetInactiveRoomsForProcessRequest req = new GetInactiveRoomsForProcessRequest() {
    ProcessId = "cbfcddd2-0006-43ae-996c-995fff7bed2e",
};


using(var res = await sdk.RoomsV2.GetInactiveRoomsForProcessAsync(req))
{
    // handle response
}

Parameters

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

Response

GetInactiveRoomsForProcessResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401,404,429 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

GetRoomInfo

Retreive current and historical allocation data for a room.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

GetRoomInfoRequest req = new GetRoomInfoRequest() {
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.RoomsV2.GetRoomInfoAsync(req))
{
    // handle response
}

Parameters

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

Response

GetRoomInfoResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401,404,422,429 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

SuspendRoomV2Deprecated

Suspend a room. The room is unallocated from the process but can be rescheduled later using the same roomId.

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

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

SuspendRoomV2DeprecatedRequest req = new SuspendRoomV2DeprecatedRequest() {
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.RoomsV2.SuspendRoomV2DeprecatedAsync(req))
{
    // handle response
}

Parameters

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

Response

SuspendRoomV2DeprecatedResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401,404,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

UpdateRoomConfig

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

UpdateRoomConfigRequest req = new UpdateRoomConfigRequest() {
    UpdateRoomConfigParams = new UpdateRoomConfigParams() {
        RoomConfig = "{\"name\":\"my-room\"}",
    },
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.RoomsV2.UpdateRoomConfigAsync(req))
{
    // handle response
}

Parameters

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

Response

UpdateRoomConfigResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401,404,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /