/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const Type = {
    Positive: "positive",
    Negative: "negative",
};
export const SubmitFeedbackType = {
    Positive: "positive",
    Negative: "negative",
};
/** @internal */
export const Type$inboundSchema = z.nativeEnum(Type);
/** @internal */
export const Type$outboundSchema = Type$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Type$;
(function (Type$) {
    /** @deprecated use `Type$inboundSchema` instead. */
    Type$.inboundSchema = Type$inboundSchema;
    /** @deprecated use `Type$outboundSchema` instead. */
    Type$.outboundSchema = Type$outboundSchema;
})(Type$ || (Type$ = {}));
/** @internal */
export const Reasons$inboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/** @internal */
export const Reasons$outboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Reasons$;
(function (Reasons$) {
    /** @deprecated use `Reasons$inboundSchema` instead. */
    Reasons$.inboundSchema = Reasons$inboundSchema;
    /** @deprecated use `Reasons$outboundSchema` instead. */
    Reasons$.outboundSchema = Reasons$outboundSchema;
})(Reasons$ || (Reasons$ = {}));
export function reasonsToJSON(reasons) {
    return JSON.stringify(Reasons$outboundSchema.parse(reasons));
}
export function reasonsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Reasons$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Reasons' from JSON`);
}
/** @internal */
export const SubmitFeedbackRequestBody$inboundSchema = z.object({
    id: z.string().optional(),
    type: Type$inboundSchema,
    messageId: z.string(),
    createdAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    reasons: z.nullable(z.array(z.lazy(() => Reasons$inboundSchema))).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
});
/** @internal */
export const SubmitFeedbackRequestBody$outboundSchema = z.object({
    id: z.string().optional(),
    type: Type$outboundSchema,
    messageId: z.string(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    reasons: z.nullable(z.array(z.lazy(() => Reasons$outboundSchema))).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SubmitFeedbackRequestBody$;
(function (SubmitFeedbackRequestBody$) {
    /** @deprecated use `SubmitFeedbackRequestBody$inboundSchema` instead. */
    SubmitFeedbackRequestBody$.inboundSchema = SubmitFeedbackRequestBody$inboundSchema;
    /** @deprecated use `SubmitFeedbackRequestBody$outboundSchema` instead. */
    SubmitFeedbackRequestBody$.outboundSchema = SubmitFeedbackRequestBody$outboundSchema;
})(SubmitFeedbackRequestBody$ || (SubmitFeedbackRequestBody$ = {}));
export function submitFeedbackRequestBodyToJSON(submitFeedbackRequestBody) {
    return JSON.stringify(SubmitFeedbackRequestBody$outboundSchema.parse(submitFeedbackRequestBody));
}
export function submitFeedbackRequestBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SubmitFeedbackRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackRequestBody' from JSON`);
}
/** @internal */
export const SubmitFeedbackType$inboundSchema = z.nativeEnum(SubmitFeedbackType);
/** @internal */
export const SubmitFeedbackType$outboundSchema = SubmitFeedbackType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SubmitFeedbackType$;
(function (SubmitFeedbackType$) {
    /** @deprecated use `SubmitFeedbackType$inboundSchema` instead. */
    SubmitFeedbackType$.inboundSchema = SubmitFeedbackType$inboundSchema;
    /** @deprecated use `SubmitFeedbackType$outboundSchema` instead. */
    SubmitFeedbackType$.outboundSchema = SubmitFeedbackType$outboundSchema;
})(SubmitFeedbackType$ || (SubmitFeedbackType$ = {}));
/** @internal */
export const SubmitFeedbackReasons$inboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/** @internal */
export const SubmitFeedbackReasons$outboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SubmitFeedbackReasons$;
(function (SubmitFeedbackReasons$) {
    /** @deprecated use `SubmitFeedbackReasons$inboundSchema` instead. */
    SubmitFeedbackReasons$.inboundSchema = SubmitFeedbackReasons$inboundSchema;
    /** @deprecated use `SubmitFeedbackReasons$outboundSchema` instead. */
    SubmitFeedbackReasons$.outboundSchema = SubmitFeedbackReasons$outboundSchema;
})(SubmitFeedbackReasons$ || (SubmitFeedbackReasons$ = {}));
export function submitFeedbackReasonsToJSON(submitFeedbackReasons) {
    return JSON.stringify(SubmitFeedbackReasons$outboundSchema.parse(submitFeedbackReasons));
}
export function submitFeedbackReasonsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SubmitFeedbackReasons$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackReasons' from JSON`);
}
/** @internal */
export const SubmitFeedbackResponseBody$inboundSchema = z.object({
    id: z.string(),
    type: SubmitFeedbackType$inboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => SubmitFeedbackReasons$inboundSchema))).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
});
/** @internal */
export const SubmitFeedbackResponseBody$outboundSchema = z.object({
    id: z.string(),
    type: SubmitFeedbackType$outboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => SubmitFeedbackReasons$outboundSchema))).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SubmitFeedbackResponseBody$;
(function (SubmitFeedbackResponseBody$) {
    /** @deprecated use `SubmitFeedbackResponseBody$inboundSchema` instead. */
    SubmitFeedbackResponseBody$.inboundSchema = SubmitFeedbackResponseBody$inboundSchema;
    /** @deprecated use `SubmitFeedbackResponseBody$outboundSchema` instead. */
    SubmitFeedbackResponseBody$.outboundSchema = SubmitFeedbackResponseBody$outboundSchema;
})(SubmitFeedbackResponseBody$ || (SubmitFeedbackResponseBody$ = {}));
export function submitFeedbackResponseBodyToJSON(submitFeedbackResponseBody) {
    return JSON.stringify(SubmitFeedbackResponseBody$outboundSchema.parse(submitFeedbackResponseBody));
}
export function submitFeedbackResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SubmitFeedbackResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackResponseBody' from JSON`);
}
//# sourceMappingURL=submitfeedback.js.map