| 1 | import * as cw from "@distilled.cloud/gcp/contentwarehouse_v1"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeRuleSetHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { GetRuleSet } from "./GetRuleSet.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link GetRuleSet}. |
| 8 | * |
| 9 | * Grants `roles/contentwarehouse.admin` on the project because |
| 10 | * `contentwarehouse.ruleSets.get` is in no narrower predefined role. |
| 11 | * |
| 12 | * @layer |
| 13 | * @provides GCP.ContentWarehouse.GetRuleSet |
| 14 | */ |
| 15 | export const GetRuleSetHttp = Layer.effect( |
| 16 | GetRuleSet, |
| 17 | makeRuleSetHttpBinding({ |
| 18 | tag: "GCP.ContentWarehouse.GetRuleSet", |
| 19 | operation: cw.getProjectsLocationsRuleSets, |
| 20 | // contentwarehouse.ruleSets.get is only in contentwarehouse.admin. |
| 21 | iam: { role: "roles/contentwarehouse.admin" }, |
| 22 | }), |
| 23 | ); |