/**
 * Cloudflare REGISTRAR API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service registrar
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
export const GetDomainRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domainName: Schema.String.pipe(T.HttpPath("domainName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/registrar/domains/{domainName}",
}));
export const GetDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const getDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetDomainRequest,
    output: GetDomainResponse,
    errors: [],
}));
export const ListDomainsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/registrar/domains" }));
export const ListDomainsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        available: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        canRegister: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        createdAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        currentRegistrar: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        expiresAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        locked: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        registrantContact: Schema.optional(Schema.Union([
            Schema.Struct({
                address: Schema.String,
                city: Schema.String,
                country: Schema.Union([Schema.String, Schema.Null]),
                firstName: Schema.Union([Schema.String, Schema.Null]),
                lastName: Schema.Union([Schema.String, Schema.Null]),
                organization: Schema.String,
                phone: Schema.Union([Schema.String, Schema.Null]),
                state: Schema.String,
                zip: Schema.Union([Schema.String, Schema.Null]),
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                address2: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                email: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                fax: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }).pipe(Schema.encodeKeys({
                address: "address",
                city: "city",
                country: "country",
                firstName: "first_name",
                lastName: "last_name",
                organization: "organization",
                phone: "phone",
                state: "state",
                zip: "zip",
                id: "id",
                address2: "address2",
                email: "email",
                fax: "fax",
            })),
            Schema.Null,
        ])),
        registryStatuses: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        supportedTld: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        transferIn: Schema.optional(Schema.Union([
            Schema.Struct({
                acceptFoa: Schema.optional(Schema.Union([Schema.Literals(["needed", "ok"]), Schema.Null])),
                approveTransfer: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "needed",
                        "ok",
                        "pending",
                        "trying",
                        "rejected",
                        "unknown",
                    ]),
                    Schema.Null,
                ])),
                canCancelTransfer: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                disablePrivacy: Schema.optional(Schema.Union([
                    Schema.Literals(["needed", "ok", "unknown"]),
                    Schema.Null,
                ])),
                enterAuthCode: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "needed",
                        "ok",
                        "pending",
                        "trying",
                        "rejected",
                    ]),
                    Schema.Null,
                ])),
                unlockDomain: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "needed",
                        "ok",
                        "pending",
                        "trying",
                        "unknown",
                    ]),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({
                acceptFoa: "accept_foa",
                approveTransfer: "approve_transfer",
                canCancelTransfer: "can_cancel_transfer",
                disablePrivacy: "disable_privacy",
                enterAuthCode: "enter_auth_code",
                unlockDomain: "unlock_domain",
            })),
            Schema.Null,
        ])),
        updatedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        available: "available",
        canRegister: "can_register",
        createdAt: "created_at",
        currentRegistrar: "current_registrar",
        expiresAt: "expires_at",
        locked: "locked",
        registrantContact: "registrant_contact",
        registryStatuses: "registry_statuses",
        supportedTld: "supported_tld",
        transferIn: "transfer_in",
        updatedAt: "updated_at",
    }))),
});
export const listDomains = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListDomainsRequest,
    output: ListDomainsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const PutDomainRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domainName: Schema.String.pipe(T.HttpPath("domainName")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    autoRenew: Schema.optional(Schema.Boolean),
    locked: Schema.optional(Schema.Boolean),
    privacy: Schema.optional(Schema.Boolean),
}).pipe(Schema.encodeKeys({
    autoRenew: "auto_renew",
    locked: "locked",
    privacy: "privacy",
}), T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/registrar/domains/{domainName}",
}));
export const PutDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const putDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutDomainRequest,
    output: PutDomainResponse,
    errors: [],
}));
//# sourceMappingURL=registrar.js.map