| 1 | import type * as rma from "@distilled.cloud/gcp/rapidmigrationassessment_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 { Collector } from "./Collector.ts"; |
| 6 | |
| 7 | export interface RegisterCollectorRequest extends Omit< |
| 8 | rma.RegisterProjectsLocationsCollectorsRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Rapid Migration Assessment `collectors.register`. |
| 14 | * |
| 15 | * Bind this operation to a {@link Collector} in a Function/Action init |
| 16 | * phase. Provide {@link RegisterCollectorHttp}. |
| 17 | * |
| 18 | * Grants `roles/rma.runner` on the project: Rapid Migration Assessment |
| 19 | * has no resource-level IAM. |
| 20 | * |
| 21 | * ### Registering Collectors |
| 22 | * **Example:** Register the bound collector |
| 23 | * ```typescript |
| 24 | * const registerCollector = |
| 25 | * yield* GCP.RapidMigrationAssessment.RegisterCollector(onPrem); |
| 26 | * yield* registerCollector(); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | * @category RapidMigrationAssessment |
| 31 | */ |
| 32 | export interface RegisterCollector extends Binding.Service< |
| 33 | RegisterCollector, |
| 34 | "GCP.RapidMigrationAssessment.RegisterCollector", |
| 35 | ( |
| 36 | collector: Collector, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request?: RegisterCollectorRequest, |
| 40 | ) => Effect.Effect< |
| 41 | rma.Operation, |
| 42 | rma.RegisterProjectsLocationsCollectorsError, |
| 43 | RuntimeContext |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | |
| 48 | export const RegisterCollector = Binding.Service<RegisterCollector>( |
| 49 | "GCP.RapidMigrationAssessment.RegisterCollector", |
| 50 | ); |