/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { fleetsV2CreateFleet } from "../funcs/fleetsV2CreateFleet.js"; import { fleetsV2DeprecatedUpdateFleetRegionV2 } from "../funcs/fleetsV2DeprecatedUpdateFleetRegionV2.js"; import { fleetsV2GetFleet } from "../funcs/fleetsV2GetFleet.js"; import { fleetsV2GetFleetMetrics } from "../funcs/fleetsV2GetFleetMetrics.js"; import { fleetsV2GetFleetRegion } from "../funcs/fleetsV2GetFleetRegion.js"; import { fleetsV2GetFleetRegionMetrics } from "../funcs/fleetsV2GetFleetRegionMetrics.js"; import { fleetsV2GetFleets } from "../funcs/fleetsV2GetFleets.js"; import { fleetsV2GetNodeShapes } from "../funcs/fleetsV2GetNodeShapes.js"; import { fleetsV2UpdateFleet } from "../funcs/fleetsV2UpdateFleet.js"; import { fleetsV2UpdateFleetRegion } from "../funcs/fleetsV2UpdateFleetRegion.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 FleetsV2 extends ClientSDK { /** * GetNodeShapes */ async getNodeShapes( orgId?: string | undefined, options?: RequestOptions, ): Promise> { return unwrapAsync(fleetsV2GetNodeShapes( this, orgId, options, )); } /** * GetFleets * * @remarks * Returns an array of [fleets](https://hathora.dev/docs/concepts/hathora-entities#fleet). */ async getFleets( orgId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2GetFleets( this, orgId, options, )); } /** * CreateFleet */ async createFleet( createFleetV2: components.CreateFleetV2, orgId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2CreateFleet( this, createFleetV2, orgId, options, )); } /** * GetFleet * * @remarks * Returns a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet). */ async getFleet( fleetId: string, orgId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2GetFleet( this, fleetId, orgId, options, )); } /** * UpdateFleet * * @remarks * Updates a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet)'s configuration. */ async updateFleet( fleetId: string, updateFleetV2: components.UpdateFleetV2, orgId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2UpdateFleet( this, fleetId, updateFleetV2, orgId, options, )); } /** * GetFleetRegion * * @remarks * Gets the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. */ async getFleetRegion( fleetId: string, region: components.Region, orgId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2GetFleetRegion( this, fleetId, region, orgId, options, )); } /** * DeprecatedUpdateFleetRegionV2 * * @remarks * Updates the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. * * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. */ async deprecatedUpdateFleetRegionV2( fleetId: string, region: components.Region, fleetRegionConfig: components.FleetRegionConfig, orgId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2DeprecatedUpdateFleetRegionV2( this, fleetId, region, fleetRegionConfig, orgId, options, )); } /** * UpdateFleetRegion * * @remarks * Updates the configuration for a given [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet) in a region. */ async updateFleetRegion( fleetId: string, region: components.Region, fleetRegionConfigV2: components.FleetRegionConfigV2, orgId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2UpdateFleetRegion( this, fleetId, region, fleetRegionConfigV2, orgId, options, )); } /** * GetFleetMetrics * * @remarks * Gets aggregate metrics for a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet). */ async getFleetMetrics( request: operations.GetFleetMetricsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2GetFleetMetrics( this, request, options, )); } /** * GetFleetRegionMetrics * * @remarks * Gets metrics for a region in a [fleet](https://hathora.dev/docs/concepts/hathora-entities#fleet). */ async getFleetRegionMetrics( request: operations.GetFleetRegionMetricsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(fleetsV2GetFleetRegionMetrics( this, request, options, )); } }