/**
 * Cloudflare EMAIL-SENDING API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service email-sending
 */
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 SendEmailSendingRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    from: Schema.Union([
        Schema.Struct({
            address: Schema.String,
            name: Schema.String,
        }),
        Schema.String,
    ]),
    subject: Schema.String,
    to: Schema.Union([Schema.String, Schema.Array(Schema.String)]),
    attachments: Schema.optional(Schema.Array(Schema.Union([
        Schema.Struct({
            content: Schema.String,
            contentId: Schema.String,
            disposition: Schema.Literal("inline"),
            filename: Schema.String,
            type: Schema.String,
        }).pipe(Schema.encodeKeys({
            content: "content",
            contentId: "content_id",
            disposition: "disposition",
            filename: "filename",
            type: "type",
        })),
        Schema.Struct({
            content: Schema.String,
            disposition: Schema.Literal("attachment"),
            filename: Schema.String,
            type: Schema.String,
        }),
    ]))),
    bcc: Schema.optional(Schema.Union([Schema.String, Schema.Array(Schema.String)])),
    cc: Schema.optional(Schema.Union([Schema.String, Schema.Array(Schema.String)])),
    headers: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    html: Schema.optional(Schema.String),
    replyTo: Schema.optional(Schema.Union([
        Schema.Struct({
            address: Schema.String,
            name: Schema.String,
        }),
        Schema.String,
    ])),
    text: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    from: "from",
    subject: "subject",
    to: "to",
    attachments: "attachments",
    bcc: "bcc",
    cc: "cc",
    headers: "headers",
    html: "html",
    replyTo: "reply_to",
    text: "text",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email/sending/send",
}));
export const SendEmailSendingResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    delivered: Schema.Array(Schema.String),
    permanentBounces: Schema.Array(Schema.String),
    queued: Schema.Array(Schema.String),
})
    .pipe(Schema.encodeKeys({
    delivered: "delivered",
    permanentBounces: "permanent_bounces",
    queued: "queued",
}))
    .pipe(T.ResponsePath("result"));
export const sendEmailSending = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SendEmailSendingRequest,
    output: SendEmailSendingResponse,
    errors: [],
}));
export const SendRawEmailSendingRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    from: Schema.String,
    mimeMessage: Schema.String,
    recipients: Schema.Array(Schema.String),
}).pipe(Schema.encodeKeys({
    from: "from",
    mimeMessage: "mime_message",
    recipients: "recipients",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email/sending/send_raw",
}));
export const SendRawEmailSendingResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    delivered: Schema.Array(Schema.String),
    permanentBounces: Schema.Array(Schema.String),
    queued: Schema.Array(Schema.String),
})
    .pipe(Schema.encodeKeys({
    delivered: "delivered",
    permanentBounces: "permanent_bounces",
    queued: "queued",
}))
    .pipe(T.ResponsePath("result"));
export const sendRawEmailSending = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SendRawEmailSendingRequest,
    output: SendRawEmailSendingResponse,
    errors: [],
}));
export const GetSubdomainRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    subdomainId: Schema.String.pipe(T.HttpPath("subdomainId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/email/sending/subdomains/{subdomainId}",
}));
export const GetSubdomainResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    enabled: Schema.Boolean,
    name: Schema.String,
    tag: Schema.String,
    created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    dkimSelector: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modified: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    returnPathDomain: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    enabled: "enabled",
    name: "name",
    tag: "tag",
    created: "created",
    dkimSelector: "dkim_selector",
    modified: "modified",
    returnPathDomain: "return_path_domain",
}))
    .pipe(T.ResponsePath("result"));
export const getSubdomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSubdomainRequest,
    output: GetSubdomainResponse,
    errors: [],
}));
export const ListSubdomainsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/email/sending/subdomains" }));
export const ListSubdomainsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        enabled: Schema.Boolean,
        name: Schema.String,
        tag: Schema.String,
        created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        dkimSelector: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        modified: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        returnPathDomain: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        enabled: "enabled",
        name: "name",
        tag: "tag",
        created: "created",
        dkimSelector: "dkim_selector",
        modified: "modified",
        returnPathDomain: "return_path_domain",
    }))),
});
export const listSubdomains = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSubdomainsRequest,
    output: ListSubdomainsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const CreateSubdomainRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    name: Schema.String,
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/email/sending/subdomains" }));
export const CreateSubdomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    enabled: Schema.Boolean,
    name: Schema.String,
    tag: Schema.String,
    created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    dkimSelector: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modified: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    returnPathDomain: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    enabled: "enabled",
    name: "name",
    tag: "tag",
    created: "created",
    dkimSelector: "dkim_selector",
    modified: "modified",
    returnPathDomain: "return_path_domain",
}))
    .pipe(T.ResponsePath("result"));
export const createSubdomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSubdomainRequest,
    output: CreateSubdomainResponse,
    errors: [],
}));
export const DeleteSubdomainRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    subdomainId: Schema.String.pipe(T.HttpPath("subdomainId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/email/sending/subdomains/{subdomainId}",
}));
export const DeleteSubdomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    errors: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    messages: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    success: Schema.Literal(true),
});
export const deleteSubdomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSubdomainRequest,
    output: DeleteSubdomainResponse,
    errors: [],
}));
export const GetSubdomainDnsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    subdomainId: Schema.String.pipe(T.HttpPath("subdomainId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/email/sending/subdomains/{subdomainId}/dns",
}));
export const GetSubdomainDnsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        ttl: Schema.optional(Schema.Union([
            Schema.Union([Schema.Number, Schema.Literal("1")]),
            Schema.Null,
        ])),
        type: Schema.optional(Schema.Union([
            Schema.Literals([
                "A",
                "AAAA",
                "CNAME",
                "HTTPS",
                "TXT",
                "SRV",
                "LOC",
                "MX",
                "NS",
                "CERT",
                "DNSKEY",
                "DS",
                "NAPTR",
                "SMIMEA",
                "SSHFP",
                "SVCB",
                "TLSA",
                "URI",
            ]),
            Schema.Null,
        ])),
    })),
});
export const getSubdomainDns = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: GetSubdomainDnsRequest,
    output: GetSubdomainDnsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
//# sourceMappingURL=email-sending.js.map