/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
/**
 * The webhooks events
 */
export const GetWebhookEvents = {
    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 GetWebhookRequest$inboundSchema = z.object({
    id: z.string(),
    teamId: z.string().optional(),
    slug: z.string().optional(),
});
/** @internal */
export const GetWebhookRequest$outboundSchema = z.object({
    id: z.string(),
    teamId: z.string().optional(),
    slug: z.string().optional(),
});
export function getWebhookRequestToJSON(getWebhookRequest) {
    return JSON.stringify(GetWebhookRequest$outboundSchema.parse(getWebhookRequest));
}
export function getWebhookRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetWebhookRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWebhookRequest' from JSON`);
}
/** @internal */
export const GetWebhookEvents$inboundSchema = z.nativeEnum(GetWebhookEvents);
/** @internal */
export const GetWebhookEvents$outboundSchema = GetWebhookEvents$inboundSchema;
/** @internal */
export const GetWebhookResponseBody$inboundSchema = z.object({
    events: z.array(GetWebhookEvents$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 GetWebhookResponseBody$outboundSchema = z.object({
    events: z.array(GetWebhookEvents$outboundSchema),
    id: z.string(),
    url: z.string(),
    ownerId: z.string(),
    createdAt: z.number(),
    updatedAt: z.number(),
    projectIds: z.array(z.string()).optional(),
});
export function getWebhookResponseBodyToJSON(getWebhookResponseBody) {
    return JSON.stringify(GetWebhookResponseBody$outboundSchema.parse(getWebhookResponseBody));
}
export function getWebhookResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetWebhookResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWebhookResponseBody' from JSON`);
}
//# sourceMappingURL=getwebhookop.js.map