/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
export const Events = {
    BudgetReached: "budget.reached",
    BudgetReset: "budget.reset",
    DomainCreated: "domain.created",
    DomainDnsRecordsChanged: "domain.dns.records.changed",
    DomainTransferInStarted: "domain.transfer-in.started",
    DomainTransferInCompleted: "domain.transfer-in.completed",
    DomainTransferInFailed: "domain.transfer-in.failed",
    DomainCertificateAdd: "domain.certificate.add",
    DomainCertificateAddFailed: "domain.certificate.add.failed",
    DomainCertificateRenew: "domain.certificate.renew",
    DomainCertificateRenewFailed: "domain.certificate.renew.failed",
    DomainCertificateDeleted: "domain.certificate.deleted",
    DomainRenewal: "domain.renewal",
    DomainRenewalFailed: "domain.renewal.failed",
    DomainAutoRenewChanged: "domain.auto-renew.changed",
    DeploymentCreated: "deployment.created",
    DeploymentCleanup: "deployment.cleanup",
    DeploymentError: "deployment.error",
    DeploymentCanceled: "deployment.canceled",
    DeploymentSucceeded: "deployment.succeeded",
    DeploymentReady: "deployment.ready",
    DeploymentCheckRerequested: "deployment.check-rerequested",
    DeploymentPromoted: "deployment.promoted",
    DeploymentIntegrationActionStart: "deployment.integration.action.start",
    DeploymentIntegrationActionCancel: "deployment.integration.action.cancel",
    DeploymentIntegrationActionCleanup: "deployment.integration.action.cleanup",
    DeploymentCheckrunStart: "deployment.checkrun.start",
    DeploymentCheckrunCancel: "deployment.checkrun.cancel",
    EdgeConfigCreated: "edge-config.created",
    EdgeConfigDeleted: "edge-config.deleted",
    EdgeConfigItemsUpdated: "edge-config.items.updated",
    FirewallAttack: "firewall.attack",
    IntegrationConfigurationPermissionUpgraded: "integration-configuration.permission-upgraded",
    IntegrationConfigurationRemoved: "integration-configuration.removed",
    IntegrationConfigurationScopeChangeConfirmed: "integration-configuration.scope-change-confirmed",
    IntegrationConfigurationTransferred: "integration-configuration.transferred",
    IntegrationResourceProjectConnected: "integration-resource.project-connected",
    IntegrationResourceProjectDisconnected: "integration-resource.project-disconnected",
    ProjectCreated: "project.created",
    ProjectRemoved: "project.removed",
    ProjectDomainCreated: "project.domain.created",
    ProjectDomainUpdated: "project.domain.updated",
    ProjectDomainDeleted: "project.domain.deleted",
    ProjectDomainVerified: "project.domain.verified",
    ProjectDomainUnverified: "project.domain.unverified",
    ProjectDomainMoved: "project.domain.moved",
    ProjectRollingReleaseStarted: "project.rolling-release.started",
    ProjectRollingReleaseAborted: "project.rolling-release.aborted",
    ProjectRollingReleaseCompleted: "project.rolling-release.completed",
    ProjectRollingReleaseApproved: "project.rolling-release.approved",
    DeploymentChecksFailed: "deployment.checks.failed",
    DeploymentChecksSucceeded: "deployment.checks.succeeded",
    DeploymentChecksCompleted: "deployment-checks-completed",
    DeploymentReadyHyphen: "deployment-ready",
    DeploymentPreparedHyphen: "deployment-prepared",
    DeploymentErrorHyphen: "deployment-error",
    DeploymentCheckRerequestedHyphen: "deployment-check-rerequested",
    DeploymentCanceledHyphen: "deployment-canceled",
    ProjectCreatedHyphen: "project-created",
    ProjectRemovedHyphen: "project-removed",
    DomainCreatedHyphen: "domain-created",
    Deployment: "deployment",
    IntegrationConfigurationPermissionUpdatedHyphen: "integration-configuration-permission-updated",
    IntegrationConfigurationRemovedHyphen: "integration-configuration-removed",
    IntegrationConfigurationScopeChangeConfirmedHyphen: "integration-configuration-scope-change-confirmed",
    MarketplaceMemberChanged: "marketplace.member.changed",
    MarketplaceInvoiceCreated: "marketplace.invoice.created",
    MarketplaceInvoicePaid: "marketplace.invoice.paid",
    MarketplaceInvoiceNotpaid: "marketplace.invoice.notpaid",
    MarketplaceInvoiceRefunded: "marketplace.invoice.refunded",
    ObservabilityAnomaly: "observability.anomaly",
    ObservabilityAnomalyError: "observability.anomaly-error",
    ObservabilityUsageAnomaly: "observability.usage-anomaly",
    ObservabilityErrorAnomaly: "observability.error-anomaly",
    ObservabilityAnomalyBotId: "observability.anomaly-botId",
    TestWebhook: "test-webhook",
};
/**
 * The webhooks events
 */
export const CreateWebhookEvents = {
    BudgetReached: "budget.reached",
    BudgetReset: "budget.reset",
    DomainCreated: "domain.created",
    DomainDnsRecordsChanged: "domain.dns.records.changed",
    DomainTransferInStarted: "domain.transfer-in.started",
    DomainTransferInCompleted: "domain.transfer-in.completed",
    DomainTransferInFailed: "domain.transfer-in.failed",
    DomainCertificateAdd: "domain.certificate.add",
    DomainCertificateAddFailed: "domain.certificate.add.failed",
    DomainCertificateRenew: "domain.certificate.renew",
    DomainCertificateRenewFailed: "domain.certificate.renew.failed",
    DomainCertificateDeleted: "domain.certificate.deleted",
    DomainRenewal: "domain.renewal",
    DomainRenewalFailed: "domain.renewal.failed",
    DomainAutoRenewChanged: "domain.auto-renew.changed",
    DeploymentCreated: "deployment.created",
    DeploymentCleanup: "deployment.cleanup",
    DeploymentError: "deployment.error",
    DeploymentCanceled: "deployment.canceled",
    DeploymentSucceeded: "deployment.succeeded",
    DeploymentReady: "deployment.ready",
    DeploymentCheckRerequested: "deployment.check-rerequested",
    DeploymentPromoted: "deployment.promoted",
    DeploymentIntegrationActionStart: "deployment.integration.action.start",
    DeploymentIntegrationActionCancel: "deployment.integration.action.cancel",
    DeploymentIntegrationActionCleanup: "deployment.integration.action.cleanup",
    DeploymentCheckrunStart: "deployment.checkrun.start",
    DeploymentCheckrunCancel: "deployment.checkrun.cancel",
    EdgeConfigCreated: "edge-config.created",
    EdgeConfigDeleted: "edge-config.deleted",
    EdgeConfigItemsUpdated: "edge-config.items.updated",
    FirewallAttack: "firewall.attack",
    IntegrationConfigurationPermissionUpgraded: "integration-configuration.permission-upgraded",
    IntegrationConfigurationRemoved: "integration-configuration.removed",
    IntegrationConfigurationScopeChangeConfirmed: "integration-configuration.scope-change-confirmed",
    IntegrationConfigurationTransferred: "integration-configuration.transferred",
    IntegrationResourceProjectConnected: "integration-resource.project-connected",
    IntegrationResourceProjectDisconnected: "integration-resource.project-disconnected",
    ProjectCreated: "project.created",
    ProjectRemoved: "project.removed",
    ProjectDomainCreated: "project.domain.created",
    ProjectDomainUpdated: "project.domain.updated",
    ProjectDomainDeleted: "project.domain.deleted",
    ProjectDomainVerified: "project.domain.verified",
    ProjectDomainUnverified: "project.domain.unverified",
    ProjectDomainMoved: "project.domain.moved",
    ProjectRollingReleaseStarted: "project.rolling-release.started",
    ProjectRollingReleaseAborted: "project.rolling-release.aborted",
    ProjectRollingReleaseCompleted: "project.rolling-release.completed",
    ProjectRollingReleaseApproved: "project.rolling-release.approved",
    DeploymentChecksFailed: "deployment.checks.failed",
    DeploymentChecksSucceeded: "deployment.checks.succeeded",
    DeploymentChecksCompleted: "deployment-checks-completed",
    DeploymentReadyHyphen: "deployment-ready",
    DeploymentPreparedHyphen: "deployment-prepared",
    DeploymentErrorHyphen: "deployment-error",
    DeploymentCheckRerequestedHyphen: "deployment-check-rerequested",
    DeploymentCanceledHyphen: "deployment-canceled",
    ProjectCreatedHyphen: "project-created",
    ProjectRemovedHyphen: "project-removed",
    DomainCreatedHyphen: "domain-created",
    Deployment: "deployment",
    IntegrationConfigurationPermissionUpdatedHyphen: "integration-configuration-permission-updated",
    IntegrationConfigurationRemovedHyphen: "integration-configuration-removed",
    IntegrationConfigurationScopeChangeConfirmedHyphen: "integration-configuration-scope-change-confirmed",
    MarketplaceMemberChanged: "marketplace.member.changed",
    MarketplaceInvoiceCreated: "marketplace.invoice.created",
    MarketplaceInvoicePaid: "marketplace.invoice.paid",
    MarketplaceInvoiceNotpaid: "marketplace.invoice.notpaid",
    MarketplaceInvoiceRefunded: "marketplace.invoice.refunded",
    ObservabilityAnomaly: "observability.anomaly",
    ObservabilityAnomalyError: "observability.anomaly-error",
    ObservabilityUsageAnomaly: "observability.usage-anomaly",
    ObservabilityErrorAnomaly: "observability.error-anomaly",
    ObservabilityAnomalyBotId: "observability.anomaly-botId",
    TestWebhook: "test-webhook",
};
/** @internal */
export const Events$inboundSchema = z
    .nativeEnum(Events);
/** @internal */
export const Events$outboundSchema = Events$inboundSchema;
/** @internal */
export const CreateWebhookRequestBody$inboundSchema = z.object({
    url: z.string(),
    events: z.array(Events$inboundSchema),
    projectIds: z.array(z.string()).optional(),
});
/** @internal */
export const CreateWebhookRequestBody$outboundSchema = z.object({
    url: z.string(),
    events: z.array(Events$outboundSchema),
    projectIds: z.array(z.string()).optional(),
});
export function createWebhookRequestBodyToJSON(createWebhookRequestBody) {
    return JSON.stringify(CreateWebhookRequestBody$outboundSchema.parse(createWebhookRequestBody));
}
export function createWebhookRequestBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateWebhookRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateWebhookRequestBody' from JSON`);
}
/** @internal */
export const CreateWebhookRequest$inboundSchema = z.object({
    teamId: z.string().optional(),
    slug: z.string().optional(),
    RequestBody: z.lazy(() => CreateWebhookRequestBody$inboundSchema),
}).transform((v) => {
    return remap$(v, {
        "RequestBody": "requestBody",
    });
});
/** @internal */
export const CreateWebhookRequest$outboundSchema = z.object({
    teamId: z.string().optional(),
    slug: z.string().optional(),
    requestBody: z.lazy(() => CreateWebhookRequestBody$outboundSchema),
}).transform((v) => {
    return remap$(v, {
        requestBody: "RequestBody",
    });
});
export function createWebhookRequestToJSON(createWebhookRequest) {
    return JSON.stringify(CreateWebhookRequest$outboundSchema.parse(createWebhookRequest));
}
export function createWebhookRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateWebhookRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateWebhookRequest' from JSON`);
}
/** @internal */
export const CreateWebhookEvents$inboundSchema = z.nativeEnum(CreateWebhookEvents);
/** @internal */
export const CreateWebhookEvents$outboundSchema = CreateWebhookEvents$inboundSchema;
/** @internal */
export const CreateWebhookResponseBody$inboundSchema = z.object({
    secret: z.string(),
    events: z.array(CreateWebhookEvents$inboundSchema),
    id: z.string(),
    url: z.string(),
    ownerId: z.string(),
    createdAt: z.number(),
    updatedAt: z.number(),
    projectIds: z.array(z.string()).optional(),
});
/** @internal */
export const CreateWebhookResponseBody$outboundSchema = z.object({
    secret: z.string(),
    events: z.array(CreateWebhookEvents$outboundSchema),
    id: z.string(),
    url: z.string(),
    ownerId: z.string(),
    createdAt: z.number(),
    updatedAt: z.number(),
    projectIds: z.array(z.string()).optional(),
});
export function createWebhookResponseBodyToJSON(createWebhookResponseBody) {
    return JSON.stringify(CreateWebhookResponseBody$outboundSchema.parse(createWebhookResponseBody));
}
export function createWebhookResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateWebhookResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateWebhookResponseBody' from JSON`);
}
//# sourceMappingURL=createwebhookop.js.map