/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { processesV3CreateProcess } from "../funcs/processesV3CreateProcess.js"; import { processesV3GetLatestProcesses } from "../funcs/processesV3GetLatestProcesses.js"; import { processesV3GetProcess } from "../funcs/processesV3GetProcess.js"; import { processesV3GetProcessesCountExperimental } from "../funcs/processesV3GetProcessesCountExperimental.js"; import { processesV3GetProcessMetrics } from "../funcs/processesV3GetProcessMetrics.js"; import { processesV3StopProcess } from "../funcs/processesV3StopProcess.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class ProcessesV3 extends ClientSDK { /** * GetLatestProcesses * * @remarks * Retrieve the 10 most recent [processes](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter the array by optionally passing in a `status` or `region`. */ async getLatestProcesses( appId?: string | undefined, status?: Array | undefined, region?: Array | undefined, before?: number | undefined, options?: RequestOptions, ): Promise> { return unwrapAsync(processesV3GetLatestProcesses( this, appId, status, region, before, options, )); } /** * GetProcessesCountExperimental * * @remarks * Count the number of [processes](https://hathora.dev/docs/concepts/hathora-entities#process) objects for an [application](https://hathora.dev/docs/concepts/hathora-entities#application). Filter by optionally passing in a `status` or `region`. */ async getProcessesCountExperimental( appId?: string | undefined, status?: Array | undefined, region?: Array | undefined, before?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(processesV3GetProcessesCountExperimental( this, appId, status, region, before, options, )); } /** * CreateProcess * * @remarks * Creates a [process](https://hathora.dev/docs/concepts/hathora-entities#process) without a room. Use this to pre-allocate processes ahead of time so that subsequent room assignment via [CreateRoom()](https://hathora.dev/api#tag/RoomV2/operation/CreateRoom) can be instant. */ async createProcess( region: components.Region, appId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(processesV3CreateProcess( this, region, appId, options, )); } /** * GetProcess * * @remarks * Get details for a [process](https://hathora.dev/docs/concepts/hathora-entities#process). */ async getProcess( processId: string, appId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(processesV3GetProcess( this, processId, appId, options, )); } /** * StopProcess * * @remarks * Stops a [process](https://hathora.dev/docs/concepts/hathora-entities#process) immediately. */ async stopProcess( processId: string, appId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(processesV3StopProcess( this, processId, appId, options, )); } /** * GetProcessMetrics */ async getProcessMetrics( request: operations.GetProcessMetricsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(processesV3GetProcessMetrics( this, request, options, )); } }