/*
 * 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 { collectExtraKeys as collectExtraKeys$, safeParse, } from "../../lib/schemas.js";
import { Conversation$inboundSchema, Conversation$outboundSchema, } from "./conversation.js";
import { Message$inboundSchema, Message$outboundSchema, } from "./message.js";
export const GetAllFeedbackResponseType = {
    Positive: "positive",
    Negative: "negative",
};
export const GetAllFeedbackResponsePositiveFeedbackType = {
    Positive: "positive",
    Negative: "negative",
    New: "new",
};
export const GetAllFeedbackResponseNegativeFeedbackType = {
    Positive: "positive",
    Negative: "negative",
};
export const GetAllFeedbackResponseNegativeFeedbackSourcesType = {
    Positive: "positive",
    Negative: "negative",
    New: "new",
};
/** @internal */
export const GetAllFeedbackResponseType$inboundSchema = z.nativeEnum(GetAllFeedbackResponseType);
/** @internal */
export const GetAllFeedbackResponseType$outboundSchema = GetAllFeedbackResponseType$inboundSchema;
/** @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(),
});
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 GetAllFeedbackResponseId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const GetAllFeedbackResponseId$outboundSchema = z.union([z.string(), z.number()]);
export function getAllFeedbackResponseIdToJSON(getAllFeedbackResponseId) {
    return JSON.stringify(GetAllFeedbackResponseId$outboundSchema.parse(getAllFeedbackResponseId));
}
export function getAllFeedbackResponseIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponseId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponseId' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponseUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const GetAllFeedbackResponseUserId$outboundSchema = z.union([z.string(), z.number()]);
export function getAllFeedbackResponseUserIdToJSON(getAllFeedbackResponseUserId) {
    return JSON.stringify(GetAllFeedbackResponseUserId$outboundSchema.parse(getAllFeedbackResponseUserId));
}
export function getAllFeedbackResponseUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponseUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponseUserId' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponseUserProperties$inboundSchema = collectExtraKeys$(z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    userType: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
export const GetAllFeedbackResponseUserProperties$outboundSchema = z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    userType: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...remap$(v, {
            additionalProperties: null,
        }),
    };
});
export function getAllFeedbackResponseUserPropertiesToJSON(getAllFeedbackResponseUserProperties) {
    return JSON.stringify(GetAllFeedbackResponseUserProperties$outboundSchema.parse(getAllFeedbackResponseUserProperties));
}
export function getAllFeedbackResponseUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponseUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponseUserProperties' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponsePositiveFeedbackType$inboundSchema = z
    .nativeEnum(GetAllFeedbackResponsePositiveFeedbackType);
/** @internal */
export const GetAllFeedbackResponsePositiveFeedbackType$outboundSchema = GetAllFeedbackResponsePositiveFeedbackType$inboundSchema;
/** @internal */
export const Sources$inboundSchema = z.object({
    type: z.nullable(GetAllFeedbackResponsePositiveFeedbackType$inboundSchema),
    title: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
/** @internal */
export const Sources$outboundSchema = z.object({
    type: z.nullable(GetAllFeedbackResponsePositiveFeedbackType$outboundSchema),
    title: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
export function sourcesToJSON(sources) {
    return JSON.stringify(Sources$outboundSchema.parse(sources));
}
export function sourcesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Sources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Sources' from JSON`);
}
/** @internal */
export const PositiveFeedback$inboundSchema = z.object({
    id: z.string(),
    type: GetAllFeedbackResponseType$inboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => Reasons$inboundSchema))).optional(),
    details: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => GetAllFeedbackResponseUserProperties$inboundSchema)).optional(),
    sources: z.nullable(z.array(z.lazy(() => Sources$inboundSchema))).optional(),
    conversation: Conversation$inboundSchema,
    message: Message$inboundSchema,
});
/** @internal */
export const PositiveFeedback$outboundSchema = z.object({
    id: z.string(),
    type: GetAllFeedbackResponseType$outboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => Reasons$outboundSchema))).optional(),
    details: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => GetAllFeedbackResponseUserProperties$outboundSchema)).optional(),
    sources: z.nullable(z.array(z.lazy(() => Sources$outboundSchema))).optional(),
    conversation: Conversation$outboundSchema,
    message: Message$outboundSchema,
});
export function positiveFeedbackToJSON(positiveFeedback) {
    return JSON.stringify(PositiveFeedback$outboundSchema.parse(positiveFeedback));
}
export function positiveFeedbackFromJSON(jsonString) {
    return safeParse(jsonString, (x) => PositiveFeedback$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PositiveFeedback' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackType$inboundSchema = z
    .nativeEnum(GetAllFeedbackResponseNegativeFeedbackType);
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackType$outboundSchema = GetAllFeedbackResponseNegativeFeedbackType$inboundSchema;
/** @internal */
export const GetAllFeedbackResponseReasons$inboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/** @internal */
export const GetAllFeedbackResponseReasons$outboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
export function getAllFeedbackResponseReasonsToJSON(getAllFeedbackResponseReasons) {
    return JSON.stringify(GetAllFeedbackResponseReasons$outboundSchema.parse(getAllFeedbackResponseReasons));
}
export function getAllFeedbackResponseReasonsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponseReasons$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponseReasons' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackId$outboundSchema = z.union([z.string(), z.number()]);
export function getAllFeedbackResponseNegativeFeedbackIdToJSON(getAllFeedbackResponseNegativeFeedbackId) {
    return JSON.stringify(GetAllFeedbackResponseNegativeFeedbackId$outboundSchema.parse(getAllFeedbackResponseNegativeFeedbackId));
}
export function getAllFeedbackResponseNegativeFeedbackIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponseNegativeFeedbackId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponseNegativeFeedbackId' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackUserId$outboundSchema = z.union([z.string(), z.number()]);
export function getAllFeedbackResponseNegativeFeedbackUserIdToJSON(getAllFeedbackResponseNegativeFeedbackUserId) {
    return JSON.stringify(GetAllFeedbackResponseNegativeFeedbackUserId$outboundSchema.parse(getAllFeedbackResponseNegativeFeedbackUserId));
}
export function getAllFeedbackResponseNegativeFeedbackUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponseNegativeFeedbackUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponseNegativeFeedbackUserId' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackUserProperties$inboundSchema = collectExtraKeys$(z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    userType: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackUserProperties$outboundSchema = z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    userType: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...remap$(v, {
            additionalProperties: null,
        }),
    };
});
export function getAllFeedbackResponseNegativeFeedbackUserPropertiesToJSON(getAllFeedbackResponseNegativeFeedbackUserProperties) {
    return JSON.stringify(GetAllFeedbackResponseNegativeFeedbackUserProperties$outboundSchema.parse(getAllFeedbackResponseNegativeFeedbackUserProperties));
}
export function getAllFeedbackResponseNegativeFeedbackUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponseNegativeFeedbackUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponseNegativeFeedbackUserProperties' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackSourcesType$inboundSchema = z
    .nativeEnum(GetAllFeedbackResponseNegativeFeedbackSourcesType);
/** @internal */
export const GetAllFeedbackResponseNegativeFeedbackSourcesType$outboundSchema = GetAllFeedbackResponseNegativeFeedbackSourcesType$inboundSchema;
/** @internal */
export const GetAllFeedbackResponseSources$inboundSchema = z.object({
    type: z.nullable(GetAllFeedbackResponseNegativeFeedbackSourcesType$inboundSchema),
    title: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
/** @internal */
export const GetAllFeedbackResponseSources$outboundSchema = z.object({
    type: z.nullable(GetAllFeedbackResponseNegativeFeedbackSourcesType$outboundSchema),
    title: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
export function getAllFeedbackResponseSourcesToJSON(getAllFeedbackResponseSources) {
    return JSON.stringify(GetAllFeedbackResponseSources$outboundSchema.parse(getAllFeedbackResponseSources));
}
export function getAllFeedbackResponseSourcesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponseSources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponseSources' from JSON`);
}
/** @internal */
export const NegativeFeedback$inboundSchema = z.object({
    id: z.string(),
    type: GetAllFeedbackResponseNegativeFeedbackType$inboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => GetAllFeedbackResponseReasons$inboundSchema))).optional(),
    details: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => GetAllFeedbackResponseNegativeFeedbackUserProperties$inboundSchema)).optional(),
    sources: z.nullable(z.array(z.lazy(() => GetAllFeedbackResponseSources$inboundSchema))).optional(),
    conversation: Conversation$inboundSchema,
    message: Message$inboundSchema,
});
/** @internal */
export const NegativeFeedback$outboundSchema = z.object({
    id: z.string(),
    type: GetAllFeedbackResponseNegativeFeedbackType$outboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => GetAllFeedbackResponseReasons$outboundSchema))).optional(),
    details: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => GetAllFeedbackResponseNegativeFeedbackUserProperties$outboundSchema)).optional(),
    sources: z.nullable(z.array(z.lazy(() => GetAllFeedbackResponseSources$outboundSchema))).optional(),
    conversation: Conversation$outboundSchema,
    message: Message$outboundSchema,
});
export function negativeFeedbackToJSON(negativeFeedback) {
    return JSON.stringify(NegativeFeedback$outboundSchema.parse(negativeFeedback));
}
export function negativeFeedbackFromJSON(jsonString) {
    return safeParse(jsonString, (x) => NegativeFeedback$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NegativeFeedback' from JSON`);
}
/** @internal */
export const GetAllFeedbackResponse$inboundSchema = z.object({
    positiveFeedbackCount: z.number(),
    negativeFeedbackCount: z.number(),
    positiveFeedback: z.array(z.lazy(() => PositiveFeedback$inboundSchema)),
    negativeFeedback: z.array(z.lazy(() => NegativeFeedback$inboundSchema)),
});
/** @internal */
export const GetAllFeedbackResponse$outboundSchema = z.object({
    positiveFeedbackCount: z.number(),
    negativeFeedbackCount: z.number(),
    positiveFeedback: z.array(z.lazy(() => PositiveFeedback$outboundSchema)),
    negativeFeedback: z.array(z.lazy(() => NegativeFeedback$outboundSchema)),
});
export function getAllFeedbackResponseToJSON(getAllFeedbackResponse) {
    return JSON.stringify(GetAllFeedbackResponse$outboundSchema.parse(getAllFeedbackResponse));
}
export function getAllFeedbackResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAllFeedbackResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllFeedbackResponse' from JSON`);
}
//# sourceMappingURL=getallfeedbackresponse.js.map