| 1 | import * as Kinesis from "@distilled.cloud/aws/kinesis"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Stream } from "./Stream.ts"; |
| 5 | |
| 6 | export interface DescribeStreamSummaryRequest extends Omit< |
| 7 | Kinesis.DescribeStreamSummaryInput, |
| 8 | "StreamName" | "StreamARN" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `kinesis:DescribeStreamSummary`. |
| 13 | * |
| 14 | * Bind this operation to a `Stream` to read its status, mode, retention, |
| 15 | * encryption, and open shard count without paginating the full shard map. |
| 16 | * Provide the implementation with |
| 17 | * `Effect.provide(AWS.Kinesis.DescribeStreamSummaryHttp)`. |
| 18 | * ### Inspecting Streams |
| 19 | * **Example:** Read the Stream Summary |
| 20 | * ```typescript |
| 21 | * // init |
| 22 | * const describeStreamSummary = yield* AWS.Kinesis.DescribeStreamSummary(stream); |
| 23 | * |
| 24 | * // runtime |
| 25 | * const result = yield* describeStreamSummary(); |
| 26 | * const summary = result.StreamDescriptionSummary; |
| 27 | * yield* Effect.log(`${summary.StreamStatus}: ${summary.OpenShardCount} shards`); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface DescribeStreamSummary extends Binding.Service< |
| 33 | DescribeStreamSummary, |
| 34 | "AWS.Kinesis.DescribeStreamSummary", |
| 35 | ( |
| 36 | stream: Stream, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request?: DescribeStreamSummaryRequest, |
| 40 | ) => Effect.Effect< |
| 41 | Kinesis.DescribeStreamSummaryOutput, |
| 42 | Kinesis.DescribeStreamSummaryError |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | |
| 47 | export const DescribeStreamSummary = Binding.Service<DescribeStreamSummary>( |
| 48 | "AWS.Kinesis.DescribeStreamSummary", |
| 49 | ); |