| 1 | import type * as oracle from "@distilled.cloud/gcp/oracledatabase_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 { AutonomousDatabase } from "./AutonomousDatabase.ts"; |
| 6 | |
| 7 | export interface GenerateWalletRequest extends Omit< |
| 8 | oracle.GenerateWalletProjectsLocationsAutonomousDatabasesRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Oracle Database `autonomousDatabases.generateWallet`. |
| 14 | * |
| 15 | * Grants `roles/oracledatabase.autonomousDatabaseAdmin` on the project |
| 16 | * because `autonomousDatabases.generateWallet` is only in the admin roles |
| 17 | * and Oracle Database@Google Cloud has no per-resource IAM. |
| 18 | * |
| 19 | * ### Downloading a wallet |
| 20 | * **Example:** Generate a SINGLE wallet |
| 21 | * ```typescript |
| 22 | * const generateWallet = yield* GCP.OracleDatabase.GenerateWallet(db); |
| 23 | * const wallet = yield* generateWallet({ |
| 24 | * body: { password: "AlchemyTest1!", type: "SINGLE" }, |
| 25 | * }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | * @category OracleDatabase |
| 30 | */ |
| 31 | export interface GenerateWallet extends Binding.Service< |
| 32 | GenerateWallet, |
| 33 | "GCP.OracleDatabase.GenerateWallet", |
| 34 | ( |
| 35 | database: AutonomousDatabase, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: GenerateWalletRequest, |
| 39 | ) => Effect.Effect< |
| 40 | oracle.GenerateAutonomousDatabaseWalletResponse, |
| 41 | oracle.GenerateWalletProjectsLocationsAutonomousDatabasesError, |
| 42 | RuntimeContext |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | |
| 47 | export const GenerateWallet = Binding.Service<GenerateWallet>( |
| 48 | "GCP.OracleDatabase.GenerateWallet", |
| 49 | ); |