| 1 | import type { Output } from "../../Output.ts"; |
| 2 | import { |
| 3 | makeNamedHttpBinding as makeGcpNamedHttpBinding, |
| 4 | type BindingIam, |
| 5 | type GcpHttpOp, |
| 6 | } from "../HttpBinding.ts"; |
| 7 | |
| 8 | /** |
| 9 | * Shared HTTP scaffolding for AI Platform named-resource bindings. |
| 10 | * NOT exported from index.ts. |
| 11 | */ |
| 12 | export const makeNamedHttpBinding = < |
| 13 | Resource extends { name: Output<string, never>; LogicalId: string }, |
| 14 | I extends { name: string }, |
| 15 | A, |
| 16 | E, |
| 17 | >(options: { |
| 18 | tag: string; |
| 19 | operation: GcpHttpOp<I, A, E>; |
| 20 | iam: BindingIam; |
| 21 | }) => |
| 22 | makeGcpNamedHttpBinding<Resource, I, A, E>({ |
| 23 | tag: options.tag, |
| 24 | operation: options.operation, |
| 25 | iam: options.iam, |
| 26 | resourceName: (resource) => resource.name, |
| 27 | }); |