| 1 | import * as translate from "@distilled.cloud/gcp/translate_v3"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { AdaptiveMtTranslate } from "./AdaptiveMtTranslate.ts"; |
| 4 | import { |
| 5 | locationParentOf, |
| 6 | makeAdaptiveMtTranslateBinding, |
| 7 | } from "./BindingHttp.ts"; |
| 8 | |
| 9 | /** |
| 10 | * HTTP implementation of {@link AdaptiveMtTranslate}. |
| 11 | * |
| 12 | * @layer |
| 13 | * @provides GCP.Translate.AdaptiveMtTranslate |
| 14 | */ |
| 15 | export const AdaptiveMtTranslateHttp = Layer.effect( |
| 16 | AdaptiveMtTranslate, |
| 17 | makeAdaptiveMtTranslateBinding({ |
| 18 | tag: "GCP.Translate.AdaptiveMtTranslate", |
| 19 | operation: translate.adaptiveMtTranslateProjectsLocations, |
| 20 | iam: { role: "roles/cloudtranslate.user" }, |
| 21 | withBody: (name, request) => ({ |
| 22 | parent: locationParentOf(name), |
| 23 | body: { |
| 24 | ...(request?.body ?? {}), |
| 25 | dataset: name, |
| 26 | }, |
| 27 | }), |
| 28 | }), |
| 29 | ); |