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