The best way to control Claude Code, Codex and more from any computer or phone

main
ts 42 lines 1.12 KB
Raw
1 import type * as pubsub from "@distilled.cloud/gcp/pubsub_v1";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import type * as Effect from "effect/Effect";
5 import type { Subscription } from "./Subscription.ts";
6
7 export interface PullRequest extends Omit<
8 pubsub.PullProjectsSubscriptionsRequest,
9 "subscription"
10 > {}
11
12 /**
13 * Runtime binding for Pub/Sub `subscriptions.pull`.
14 *
15 * Bind this operation to a {@link Subscription} in a Function/Action init
16 * phase. Provide {@link PullHttp}.
17 *
18 * ### Pulling Messages
19 * **Example:** Pull messages
20 * ```typescript
21 * const pull = yield* GCP.PubSub.Pull(subscription);
22 * const { receivedMessages } = yield* pull({
23 * body: { maxMessages: 10 },
24 * });
25 * ```
26 *
27 * @binding
28 * @category PubSub
29 */
30 export interface Pull extends Binding.Service<
31 Pull,
32 "GCP.PubSub.Pull",
33 (
34 subscription: Subscription,
35 ) => Effect.Effect<
36 (
37 request: PullRequest,
38 ) => Effect.Effect<pubsub.PullResponse, pubsub.PullProjectsSubscriptionsError, RuntimeContext>
39 >
40 > {}
41
42 export const Pull = Binding.Service<Pull>("GCP.PubSub.Pull");