sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ MediaConvert/ Probe.ts

import type * as mediaconvert from "@distilled.cloud/aws/mediaconvert";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";

/**
 * Runtime binding for `mediaconvert:Probe` — analyze an input media file in
 * S3 (or over HTTPS) and get back its container, codecs, frame rate,
 * resolution, track layout, and captions, to drive transcoding decisions at
 * runtime.
 *
 * The binding takes no arguments and grants `mediaconvert:Probe` on `*`.
 * Note the probing itself reads the file with the *caller's* credentials —
 * the Function also needs S3 read access to the probed object (bind an
 * `AWS.S3.GetObject` capability on the bucket).
 * Provide the implementation with `Effect.provide(AWS.MediaConvert.ProbeHttp)`.
 *
 * ### Inspecting Inputs
 * **Example:** Probe an Uploaded File
 * ```typescript
 * // init
 * const probe = yield* AWS.MediaConvert.Probe();
 *
 * // runtime
 * const { ProbeResults } = yield* probe({
 *   InputFiles: [{ FileUrl: `s3://${bucket}/${key}` }],
 * });
 * const video = ProbeResults?.[0]?.TrackMappings;
 * ```
 *
 * @binding
 */
export interface Probe extends Binding.Service<
  Probe,
  "AWS.MediaConvert.Probe",
  () => Effect.Effect<
    (
      request: mediaconvert.ProbeRequest,
    ) => Effect.Effect<mediaconvert.ProbeResponse, mediaconvert.ProbeError>
  >
> {}
export const Probe = Binding.Service<Probe>("AWS.MediaConvert.Probe");