/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
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",
    DeploymentCreated: "deployment.created",
    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",
    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",
    ProjectCreated: "project.created",
    ProjectRemoved: "project.removed",
    DeploymentChecksCompletedLegacy: "deployment-checks-completed",
    DeploymentReadyLegacy: "deployment-ready",
    DeploymentPreparedLegacy: "deployment-prepared",
    DeploymentErrorLegacy: "deployment-error",
    DeploymentCheckRerequestedLegacy: "deployment-check-rerequested",
    DeploymentCanceledLegacy: "deployment-canceled",
    ProjectCreatedLegacy: "project-created",
    ProjectRemovedLegacy: "project-removed",
    DomainCreatedLegacy: "domain-created",
    DeploymentLegacy: "deployment",
    IntegrationConfigurationPermissionUpdatedLegacy: "integration-configuration-permission-updated",
    IntegrationConfigurationRemovedLegacy: "integration-configuration-removed",
    IntegrationConfigurationScopeChangeConfirmedLegacy: "integration-configuration-scope-change-confirmed",
    MarketplaceInvoiceCreated: "marketplace.invoice.created",
    MarketplaceInvoicePaid: "marketplace.invoice.paid",
    MarketplaceInvoiceNotpaid: "marketplace.invoice.notpaid",
    MarketplaceInvoiceRefunded: "marketplace.invoice.refunded",
    TestWebhook: "observability.anomaly",
    undefined: "test-webhook",
};
/**
 * The webhooks events
 */
export const CreateWebhookEvents = {
    BudgetReached: "budget.reached",
    BudgetReset: "budget.reset",
    DomainCreated: "domain.created",
    DeploymentCreated: "deployment.created",
    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",
    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",
    ProjectCreated: "project.created",
    ProjectRemoved: "project.removed",
    DeploymentChecksCompletedLegacy: "deployment-checks-completed",
    DeploymentReadyLegacy: "deployment-ready",
    DeploymentPreparedLegacy: "deployment-prepared",
    DeploymentErrorLegacy: "deployment-error",
    DeploymentCheckRerequestedLegacy: "deployment-check-rerequested",
    DeploymentCanceledLegacy: "deployment-canceled",
    ProjectCreatedLegacy: "project-created",
    ProjectRemovedLegacy: "project-removed",
    DomainCreatedLegacy: "domain-created",
    DeploymentLegacy: "deployment",
    IntegrationConfigurationPermissionUpdatedLegacy: "integration-configuration-permission-updated",
    IntegrationConfigurationRemovedLegacy: "integration-configuration-removed",
    IntegrationConfigurationScopeChangeConfirmedLegacy: "integration-configuration-scope-change-confirmed",
    MarketplaceInvoiceCreated: "marketplace.invoice.created",
    MarketplaceInvoicePaid: "marketplace.invoice.paid",
    MarketplaceInvoiceNotpaid: "marketplace.invoice.notpaid",
    MarketplaceInvoiceRefunded: "marketplace.invoice.refunded",
    TestWebhook: "observability.anomaly",
    undefined: "test-webhook",
};
/** @internal */
export const Events$inboundSchema = z
    .nativeEnum(Events);
/** @internal */
export const Events$outboundSchema = Events$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Events$;
(function (Events$) {
    /** @deprecated use `Events$inboundSchema` instead. */
    Events$.inboundSchema = Events$inboundSchema;
    /** @deprecated use `Events$outboundSchema` instead. */
    Events$.outboundSchema = Events$outboundSchema;
})(Events$ || (Events$ = {}));
/** @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(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateWebhookRequestBody$;
(function (CreateWebhookRequestBody$) {
    /** @deprecated use `CreateWebhookRequestBody$inboundSchema` instead. */
    CreateWebhookRequestBody$.inboundSchema = CreateWebhookRequestBody$inboundSchema;
    /** @deprecated use `CreateWebhookRequestBody$outboundSchema` instead. */
    CreateWebhookRequestBody$.outboundSchema = CreateWebhookRequestBody$outboundSchema;
})(CreateWebhookRequestBody$ || (CreateWebhookRequestBody$ = {}));
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",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateWebhookRequest$;
(function (CreateWebhookRequest$) {
    /** @deprecated use `CreateWebhookRequest$inboundSchema` instead. */
    CreateWebhookRequest$.inboundSchema = CreateWebhookRequest$inboundSchema;
    /** @deprecated use `CreateWebhookRequest$outboundSchema` instead. */
    CreateWebhookRequest$.outboundSchema = CreateWebhookRequest$outboundSchema;
})(CreateWebhookRequest$ || (CreateWebhookRequest$ = {}));
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
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateWebhookEvents$;
(function (CreateWebhookEvents$) {
    /** @deprecated use `CreateWebhookEvents$inboundSchema` instead. */
    CreateWebhookEvents$.inboundSchema = CreateWebhookEvents$inboundSchema;
    /** @deprecated use `CreateWebhookEvents$outboundSchema` instead. */
    CreateWebhookEvents$.outboundSchema = CreateWebhookEvents$outboundSchema;
})(CreateWebhookEvents$ || (CreateWebhookEvents$ = {}));
/** @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(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateWebhookResponseBody$;
(function (CreateWebhookResponseBody$) {
    /** @deprecated use `CreateWebhookResponseBody$inboundSchema` instead. */
    CreateWebhookResponseBody$.inboundSchema = CreateWebhookResponseBody$inboundSchema;
    /** @deprecated use `CreateWebhookResponseBody$outboundSchema` instead. */
    CreateWebhookResponseBody$.outboundSchema = CreateWebhookResponseBody$outboundSchema;
})(CreateWebhookResponseBody$ || (CreateWebhookResponseBody$ = {}));
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