/*
 * 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";
import { UriType$inboundSchema, UriType$outboundSchema, } from "./uritype.js";
/** @internal */
export const TriggerInfo$inboundSchema = z.object({
    id: z.string().optional(),
    product_environment_id: z.string().optional(),
    uri_type: UriType$inboundSchema,
    uri: z.string(),
    event_type: z.string().optional(),
    created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
}).transform((v) => {
    return remap$(v, {
        "product_environment_id": "productEnvironmentId",
        "uri_type": "uriType",
        "event_type": "eventType",
        "created_at": "createdAt",
        "updated_at": "updatedAt",
    });
});
/** @internal */
export const TriggerInfo$outboundSchema = z.object({
    id: z.string().optional(),
    productEnvironmentId: z.string().optional(),
    uriType: UriType$outboundSchema,
    uri: z.string(),
    eventType: z.string().optional(),
    createdAt: z.date().transform(v => v.toISOString()).optional(),
    updatedAt: z.date().transform(v => v.toISOString()).optional(),
}).transform((v) => {
    return remap$(v, {
        productEnvironmentId: "product_environment_id",
        uriType: "uri_type",
        eventType: "event_type",
        createdAt: "created_at",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var TriggerInfo$;
(function (TriggerInfo$) {
    /** @deprecated use `TriggerInfo$inboundSchema` instead. */
    TriggerInfo$.inboundSchema = TriggerInfo$inboundSchema;
    /** @deprecated use `TriggerInfo$outboundSchema` instead. */
    TriggerInfo$.outboundSchema = TriggerInfo$outboundSchema;
})(TriggerInfo$ || (TriggerInfo$ = {}));
export function triggerInfoToJSON(triggerInfo) {
    return JSON.stringify(TriggerInfo$outboundSchema.parse(triggerInfo));
}
export function triggerInfoFromJSON(jsonString) {
    return safeParse(jsonString, (x) => TriggerInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TriggerInfo' from JSON`);
}
//# sourceMappingURL=triggerinfo.js.map