| 1 | import type * as recommendationengine from "@distilled.cloud/gcp/recommendationengine_v1beta1"; |
| 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 { CatalogsCatalogItem } from "./CatalogsCatalogItem.ts"; |
| 6 | |
| 7 | export interface GetCatalogItemRequest extends Omit< |
| 8 | recommendationengine.GetProjectsLocationsCatalogsCatalogItemsRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Recommendations AI `catalogItems.get`. |
| 14 | * |
| 15 | * Bind this operation to a {@link CatalogsCatalogItem} in a Function |
| 16 | * or Action init phase. Provide {@link GetCatalogItemHttp}. |
| 17 | * |
| 18 | * Grants `roles/automlrecommendations.viewer` on the project: |
| 19 | * Recommendations AI has no resource-level IAM. |
| 20 | * |
| 21 | * ### Reading Catalog Items |
| 22 | * **Example:** Read the bound catalog item |
| 23 | * ```typescript |
| 24 | * const getCatalogItem = yield* GCP.RecommendationEngine.GetCatalogItem(item); |
| 25 | * const live = yield* getCatalogItem(); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | * @category RecommendationEngine |
| 30 | */ |
| 31 | export interface GetCatalogItem extends Binding.Service< |
| 32 | GetCatalogItem, |
| 33 | "GCP.RecommendationEngine.GetCatalogItem", |
| 34 | ( |
| 35 | item: CatalogsCatalogItem, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request?: GetCatalogItemRequest, |
| 39 | ) => Effect.Effect< |
| 40 | recommendationengine.GoogleCloudRecommendationengineV1beta1CatalogItem, |
| 41 | recommendationengine.GetProjectsLocationsCatalogsCatalogItemsError, |
| 42 | RuntimeContext |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | |
| 47 | export const GetCatalogItem = Binding.Service<GetCatalogItem>( |
| 48 | "GCP.RecommendationEngine.GetCatalogItem", |
| 49 | ); |