| 1 | import type * as pubsublite from "@distilled.cloud/gcp/pubsublite_v1"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../../RuntimeContext.ts"; |
| 5 | import type { AdminSubscription } from "./AdminSubscription.ts"; |
| 6 | |
| 7 | export interface GetSubscriptionRequest extends Omit< |
| 8 | pubsublite.GetAdminProjectsLocationsSubscriptionsRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Pub/Sub Lite `subscriptions.get`. |
| 14 | * |
| 15 | * Bind this operation to an {@link AdminSubscription} in a Function/Action |
| 16 | * init phase. Provide {@link GetSubscriptionHttp}. |
| 17 | * |
| 18 | * Grants `roles/pubsublite.viewer` on the project: Pub/Sub Lite has no |
| 19 | * resource-level IAM. |
| 20 | * |
| 21 | * ### Observing Subscriptions |
| 22 | * **Example:** Read the bound subscription |
| 23 | * ```typescript |
| 24 | * const getSubscription = yield* GCP.PubSubLite.GetSubscription(inbox); |
| 25 | * const live = yield* getSubscription(); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | * @category PubSubLite |
| 30 | */ |
| 31 | export interface GetSubscription extends Binding.Service< |
| 32 | GetSubscription, |
| 33 | "GCP.PubSubLite.GetSubscription", |
| 34 | ( |
| 35 | subscription: AdminSubscription, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request?: GetSubscriptionRequest, |
| 39 | ) => Effect.Effect< |
| 40 | pubsublite.Subscription, |
| 41 | pubsublite.GetAdminProjectsLocationsSubscriptionsError, |
| 42 | RuntimeContext |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | |
| 47 | export const GetSubscription = Binding.Service<GetSubscription>( |
| 48 | "GCP.PubSubLite.GetSubscription", |
| 49 | ); |