sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ SSM/ UnlabelParameterVersion.ts

import type * as SSM from "@distilled.cloud/aws/ssm";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Parameter } from "./Parameter.ts";

export interface UnlabelParameterVersionRequest extends Omit<
  SSM.UnlabelParameterVersionRequest,
  "Name"
> {}

/**
 * Runtime binding for `ssm:UnlabelParameterVersion`.
 *
 * Bind this operation to a `Parameter` inside a function runtime to get a
 * callable that removes labels from a specific version of the bound
 * parameter — the counterpart to `LabelParameterVersion` when moving a label
 * during a rollout or rollback.
 * ### Labeling Parameter Versions
 * **Example:** Remove a Label From a Version
 * ```typescript
 * const unlabel = yield* SSM.UnlabelParameterVersion(config);
 *
 * const result = yield* unlabel({
 *   ParameterVersion: 3,
 *   Labels: ["current"],
 * });
 * yield* Effect.log(`removed: ${result.RemovedLabels?.join(", ")}`);
 * ```
 *
 * @binding
 */
export interface UnlabelParameterVersion extends Binding.Service<
  UnlabelParameterVersion,
  "AWS.SSM.UnlabelParameterVersion",
  <P extends Parameter>(
    parameter: P,
  ) => Effect.Effect<
    (
      request: UnlabelParameterVersionRequest,
    ) => Effect.Effect<SSM.UnlabelParameterVersionResult, SSM.UnlabelParameterVersionError>
  >
> {}
export const UnlabelParameterVersion = Binding.Service<UnlabelParameterVersion>(
  "AWS.SSM.UnlabelParameterVersion",
);