/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 607335816380 */ import { commandsBootstrap } from "../funcs/commandsBootstrap.js"; import { commandsComplete } from "../funcs/commandsComplete.js"; import { commandsCreate } from "../funcs/commandsCreate.js"; import { commandsDispatch } from "../funcs/commandsDispatch.js"; import { commandsGet } from "../funcs/commandsGet.js"; import { commandsIncrementAttempt } from "../funcs/commandsIncrementAttempt.js"; import { commandsList } from "../funcs/commandsList.js"; import { commandsListDeployments } from "../funcs/commandsListDeployments.js"; import { commandsListNames } from "../funcs/commandsListNames.js"; import { commandsResolveTarget } from "../funcs/commandsResolveTarget.js"; import { commandsUpdate } from "../funcs/commandsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Commands extends ClientSDK { /** * Resolve a deployment's current manager and mint a five-minute command capability. Sender tokens can dispatch and observe commands only for this deployment. Receiver tokens can lease and complete commands only for the resolved Container or Daemon target. */ async bootstrap( request: models.CommandBootstrapRequest, options?: RequestOptions, ): Promise { return unwrapAsync(commandsBootstrap( this, request, options, )); } /** * Retrieve commands. Use for dashboard analytics and command history. */ async list( request?: operations.ListCommandsRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(commandsList( this, request, options, )); } /** * Create command metadata. Called by manager when processing commands. Returns project info for routing decisions. */ async create( request?: models.CreateCommandRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(commandsCreate( this, request, options, )); } /** * List distinct command names. Use for filter dropdowns in the dashboard. */ async listNames( request?: operations.ListCommandNamesRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(commandsListNames( this, request, options, )); } /** * List distinct deployments that have commands, including deployment group info. Use for filter dropdowns in the dashboard. */ async listDeployments( request?: operations.ListCommandDeploymentsRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(commandsListDeployments( this, request, options, )); } /** * Resolve which resource a command for this deployment would be addressed to, and how it would be delivered. Fails when the deployment has no command-capable resources, or more than one and no explicit target was named. */ async resolveTarget( request: operations.ResolveCommandTargetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(commandsResolveTarget( this, request, options, )); } /** * Update command state. Called by manager when command is dispatched or completes. */ async update( request: operations.UpdateCommandRequest, options?: RequestOptions, ): Promise { return unwrapAsync(commandsUpdate( this, request, options, )); } /** * Retrieve a command by ID. */ async get( request: operations.GetCommandRequest, options?: RequestOptions, ): Promise { return unwrapAsync(commandsGet( this, request, options, )); } /** * Atomically mark a command DISPATCHED unless it is already terminal. Returns whether the transition was applied. */ async dispatch( request: operations.DispatchCommandRequest, options?: RequestOptions, ): Promise { return unwrapAsync(commandsDispatch( this, request, options, )); } /** * Atomically transition a command to a terminal state (SUCCEEDED, FAILED, or EXPIRED) unless it is already terminal. Returns whether the transition was applied. */ async complete( request: operations.CompleteCommandRequest, options?: RequestOptions, ): Promise { return unwrapAsync(commandsComplete( this, request, options, )); } /** * Atomically increment the command's attempt counter and return the new value. */ async incrementAttempt( request: operations.IncrementCommandAttemptRequest, options?: RequestOptions, ): Promise { return unwrapAsync(commandsIncrementAttempt( this, request, options, )); } }