/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { environmentsCreate } from "../funcs/environmentsCreate.js"; import { environmentsDelete } from "../funcs/environmentsDelete.js"; import { environmentsDiff } from "../funcs/environmentsDiff.js"; import { environmentsGetTags } from "../funcs/environmentsGetTags.js"; import { environmentsList } from "../funcs/environmentsList.js"; import { environmentsPublish } from "../funcs/environmentsPublish.js"; import { environmentsUpdate } from "../funcs/environmentsUpdate.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 Environments extends ClientSDK { /** * List environment tags * * @remarks * Retrieve all unique tags used in workflows within the specified environment. These tags can be used for filtering workflows. */ async getTags( environmentId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(environmentsGetTags( this, environmentId, idempotencyKey, options, )); } /** * Compare resources between environments * * @remarks * Compares workflows and other resources between the source and target environments, returning detailed diff information including additions, modifications, and deletions. */ async diff( diffEnvironmentRequestDto: components.DiffEnvironmentRequestDto, targetEnvironmentId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(environmentsDiff( this, diffEnvironmentRequestDto, targetEnvironmentId, idempotencyKey, options, )); } /** * Publish resources to target environment * * @remarks * Publishes all workflows and resources from the source environment to the target environment. Optionally specify specific resources to publish or use dryRun mode to preview changes. */ async publish( publishEnvironmentRequestDto: components.PublishEnvironmentRequestDto, targetEnvironmentId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(environmentsPublish( this, publishEnvironmentRequestDto, targetEnvironmentId, idempotencyKey, options, )); } /** * Create an environment * * @remarks * Creates a new environment within the current organization. * Environments allow you to manage different stages of your application development lifecycle. * Each environment has its own set of API keys and configurations. */ async create( createEnvironmentRequestDto: components.CreateEnvironmentRequestDto, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(environmentsCreate( this, createEnvironmentRequestDto, idempotencyKey, options, )); } /** * List all environments * * @remarks * This API returns a list of environments for the current organization. * Each environment contains its configuration, API keys (if user has access), and metadata. */ async list( idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(environmentsList( this, idempotencyKey, options, )); } /** * Update an environment * * @remarks * Update an environment by its unique identifier **environmentId**. * You can modify the environment name, identifier, color, and other configuration settings. */ async update( updateEnvironmentRequestDto: components.UpdateEnvironmentRequestDto, environmentId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(environmentsUpdate( this, updateEnvironmentRequestDto, environmentId, idempotencyKey, options, )); } /** * Delete an environment * * @remarks * Delete an environment by its unique identifier **environmentId**. * This action is irreversible and will remove the environment and all its associated data. */ async delete( environmentId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< operations.EnvironmentsControllerV1DeleteEnvironmentResponse | undefined > { return unwrapAsync(environmentsDelete( this, environmentId, idempotencyKey, options, )); } }