| 1 | import type * as route53domains from "@distilled.cloud/aws/route-53-domains"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface RetrieveDomainAuthCodeRequest |
| 6 | extends route53domains.RetrieveDomainAuthCodeRequest {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `route53domains:RetrieveDomainAuthCode` — retrieve |
| 10 | * the authorization (transfer) code for a domain registered in the current |
| 11 | * AWS account. The code is required to transfer the domain to another |
| 12 | * registrar. |
| 13 | * |
| 14 | * The returned `AuthCode` is a secret and is typed as |
| 15 | * `Redacted.Redacted<string>` — unwrap with `Redacted.value` only at the |
| 16 | * point of use. Requesting the code for a domain that is not registered in |
| 17 | * the account fails with a typed `DomainNotFound` error. |
| 18 | * |
| 19 | * Route 53 Domains is a global registration API with no resource-level IAM: |
| 20 | * the binding takes no arguments and grants the function |
| 21 | * `route53domains:RetrieveDomainAuthCode` on `*`. Calls are pinned to |
| 22 | * `us-east-1`, the only region that serves the Route 53 Domains API, |
| 23 | * regardless of where the function runs. |
| 24 | * |
| 25 | * Provide the implementation with |
| 26 | * `Effect.provide(AWS.Route53Domains.RetrieveDomainAuthCodeHttp)`. |
| 27 | * |
| 28 | * ### Transferring Domains Out |
| 29 | * **Example:** Retrieve the Transfer Authorization Code |
| 30 | * ```typescript |
| 31 | * import * as Redacted from "effect/Redacted"; |
| 32 | * |
| 33 | * // init |
| 34 | * const retrieveDomainAuthCode = |
| 35 | * yield* AWS.Route53Domains.RetrieveDomainAuthCode(); |
| 36 | * |
| 37 | * // runtime |
| 38 | * const result = yield* retrieveDomainAuthCode({ DomainName: "example.com" }); |
| 39 | * const authCode = |
| 40 | * result.AuthCode !== undefined && typeof result.AuthCode !== "string" |
| 41 | * ? Redacted.value(result.AuthCode) |
| 42 | * : result.AuthCode; |
| 43 | * ``` |
| 44 | * |
| 45 | * @binding |
| 46 | */ |
| 47 | export interface RetrieveDomainAuthCode extends Binding.Service< |
| 48 | RetrieveDomainAuthCode, |
| 49 | "AWS.Route53Domains.RetrieveDomainAuthCode", |
| 50 | () => Effect.Effect< |
| 51 | ( |
| 52 | request: RetrieveDomainAuthCodeRequest, |
| 53 | ) => Effect.Effect< |
| 54 | route53domains.RetrieveDomainAuthCodeResponse, |
| 55 | route53domains.RetrieveDomainAuthCodeError |
| 56 | > |
| 57 | > |
| 58 | > {} |
| 59 | export const RetrieveDomainAuthCode = Binding.Service<RetrieveDomainAuthCode>( |
| 60 | "AWS.Route53Domains.RetrieveDomainAuthCode", |
| 61 | ); |