/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
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 GetAllFeedbackResponseNegativeFeedbackType = {
    Positive: "positive",
    Negative: "negative",
};
/** @internal */
export const GetAllFeedbackResponseType$inboundSchema = z.nativeEnum(GetAllFeedbackResponseType);
/** @internal */
export const GetAllFeedbackResponseType$outboundSchema = GetAllFeedbackResponseType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseType$;
(function (GetAllFeedbackResponseType$) {
    /** @deprecated use `GetAllFeedbackResponseType$inboundSchema` instead. */
    GetAllFeedbackResponseType$.inboundSchema = GetAllFeedbackResponseType$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseType$outboundSchema` instead. */
    GetAllFeedbackResponseType$.outboundSchema = GetAllFeedbackResponseType$outboundSchema;
})(GetAllFeedbackResponseType$ || (GetAllFeedbackResponseType$ = {}));
/** @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 GetAllFeedbackResponseId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const GetAllFeedbackResponseId$outboundSchema = z.union([z.string(), z.number()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseId$;
(function (GetAllFeedbackResponseId$) {
    /** @deprecated use `GetAllFeedbackResponseId$inboundSchema` instead. */
    GetAllFeedbackResponseId$.inboundSchema = GetAllFeedbackResponseId$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseId$outboundSchema` instead. */
    GetAllFeedbackResponseId$.outboundSchema = GetAllFeedbackResponseId$outboundSchema;
})(GetAllFeedbackResponseId$ || (GetAllFeedbackResponseId$ = {}));
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()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseUserId$;
(function (GetAllFeedbackResponseUserId$) {
    /** @deprecated use `GetAllFeedbackResponseUserId$inboundSchema` instead. */
    GetAllFeedbackResponseUserId$.inboundSchema = GetAllFeedbackResponseUserId$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseUserId$outboundSchema` instead. */
    GetAllFeedbackResponseUserId$.outboundSchema = GetAllFeedbackResponseUserId$outboundSchema;
})(GetAllFeedbackResponseUserId$ || (GetAllFeedbackResponseUserId$ = {}));
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(),
}).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(),
    additionalProperties: z.record(z.any()),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...remap$(v, {
            additionalProperties: null,
        }),
    };
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseUserProperties$;
(function (GetAllFeedbackResponseUserProperties$) {
    /** @deprecated use `GetAllFeedbackResponseUserProperties$inboundSchema` instead. */
    GetAllFeedbackResponseUserProperties$.inboundSchema = GetAllFeedbackResponseUserProperties$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseUserProperties$outboundSchema` instead. */
    GetAllFeedbackResponseUserProperties$.outboundSchema = GetAllFeedbackResponseUserProperties$outboundSchema;
})(GetAllFeedbackResponseUserProperties$ || (GetAllFeedbackResponseUserProperties$ = {}));
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 PositiveFeedback$inboundSchema = z.object({
    id: z.string(),
    type: GetAllFeedbackResponseType$inboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => Reasons$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => GetAllFeedbackResponseUserProperties$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(),
    reasons: z.nullable(z.array(z.lazy(() => Reasons$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => GetAllFeedbackResponseUserProperties$outboundSchema)).optional(),
    conversation: Conversation$outboundSchema,
    message: Message$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var PositiveFeedback$;
(function (PositiveFeedback$) {
    /** @deprecated use `PositiveFeedback$inboundSchema` instead. */
    PositiveFeedback$.inboundSchema = PositiveFeedback$inboundSchema;
    /** @deprecated use `PositiveFeedback$outboundSchema` instead. */
    PositiveFeedback$.outboundSchema = PositiveFeedback$outboundSchema;
})(PositiveFeedback$ || (PositiveFeedback$ = {}));
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
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseNegativeFeedbackType$;
(function (GetAllFeedbackResponseNegativeFeedbackType$) {
    /** @deprecated use `GetAllFeedbackResponseNegativeFeedbackType$inboundSchema` instead. */
    GetAllFeedbackResponseNegativeFeedbackType$.inboundSchema = GetAllFeedbackResponseNegativeFeedbackType$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseNegativeFeedbackType$outboundSchema` instead. */
    GetAllFeedbackResponseNegativeFeedbackType$.outboundSchema = GetAllFeedbackResponseNegativeFeedbackType$outboundSchema;
})(GetAllFeedbackResponseNegativeFeedbackType$ || (GetAllFeedbackResponseNegativeFeedbackType$ = {}));
/** @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(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseReasons$;
(function (GetAllFeedbackResponseReasons$) {
    /** @deprecated use `GetAllFeedbackResponseReasons$inboundSchema` instead. */
    GetAllFeedbackResponseReasons$.inboundSchema = GetAllFeedbackResponseReasons$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseReasons$outboundSchema` instead. */
    GetAllFeedbackResponseReasons$.outboundSchema = GetAllFeedbackResponseReasons$outboundSchema;
})(GetAllFeedbackResponseReasons$ || (GetAllFeedbackResponseReasons$ = {}));
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()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseNegativeFeedbackId$;
(function (GetAllFeedbackResponseNegativeFeedbackId$) {
    /** @deprecated use `GetAllFeedbackResponseNegativeFeedbackId$inboundSchema` instead. */
    GetAllFeedbackResponseNegativeFeedbackId$.inboundSchema = GetAllFeedbackResponseNegativeFeedbackId$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseNegativeFeedbackId$outboundSchema` instead. */
    GetAllFeedbackResponseNegativeFeedbackId$.outboundSchema = GetAllFeedbackResponseNegativeFeedbackId$outboundSchema;
})(GetAllFeedbackResponseNegativeFeedbackId$ || (GetAllFeedbackResponseNegativeFeedbackId$ = {}));
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()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseNegativeFeedbackUserId$;
(function (GetAllFeedbackResponseNegativeFeedbackUserId$) {
    /** @deprecated use `GetAllFeedbackResponseNegativeFeedbackUserId$inboundSchema` instead. */
    GetAllFeedbackResponseNegativeFeedbackUserId$.inboundSchema = GetAllFeedbackResponseNegativeFeedbackUserId$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseNegativeFeedbackUserId$outboundSchema` instead. */
    GetAllFeedbackResponseNegativeFeedbackUserId$.outboundSchema = GetAllFeedbackResponseNegativeFeedbackUserId$outboundSchema;
})(GetAllFeedbackResponseNegativeFeedbackUserId$ || (GetAllFeedbackResponseNegativeFeedbackUserId$ = {}));
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(),
}).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(),
    additionalProperties: z.record(z.any()),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...remap$(v, {
            additionalProperties: null,
        }),
    };
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponseNegativeFeedbackUserProperties$;
(function (GetAllFeedbackResponseNegativeFeedbackUserProperties$) {
    /** @deprecated use `GetAllFeedbackResponseNegativeFeedbackUserProperties$inboundSchema` instead. */
    GetAllFeedbackResponseNegativeFeedbackUserProperties$.inboundSchema = GetAllFeedbackResponseNegativeFeedbackUserProperties$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponseNegativeFeedbackUserProperties$outboundSchema` instead. */
    GetAllFeedbackResponseNegativeFeedbackUserProperties$.outboundSchema = GetAllFeedbackResponseNegativeFeedbackUserProperties$outboundSchema;
})(GetAllFeedbackResponseNegativeFeedbackUserProperties$ || (GetAllFeedbackResponseNegativeFeedbackUserProperties$ = {}));
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 NegativeFeedback$inboundSchema = z.object({
    id: z.string(),
    type: GetAllFeedbackResponseNegativeFeedbackType$inboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => GetAllFeedbackResponseReasons$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => GetAllFeedbackResponseNegativeFeedbackUserProperties$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(),
    reasons: z.nullable(z.array(z.lazy(() => GetAllFeedbackResponseReasons$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => GetAllFeedbackResponseNegativeFeedbackUserProperties$outboundSchema)).optional(),
    conversation: Conversation$outboundSchema,
    message: Message$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var NegativeFeedback$;
(function (NegativeFeedback$) {
    /** @deprecated use `NegativeFeedback$inboundSchema` instead. */
    NegativeFeedback$.inboundSchema = NegativeFeedback$inboundSchema;
    /** @deprecated use `NegativeFeedback$outboundSchema` instead. */
    NegativeFeedback$.outboundSchema = NegativeFeedback$outboundSchema;
})(NegativeFeedback$ || (NegativeFeedback$ = {}));
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)),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAllFeedbackResponse$;
(function (GetAllFeedbackResponse$) {
    /** @deprecated use `GetAllFeedbackResponse$inboundSchema` instead. */
    GetAllFeedbackResponse$.inboundSchema = GetAllFeedbackResponse$inboundSchema;
    /** @deprecated use `GetAllFeedbackResponse$outboundSchema` instead. */
    GetAllFeedbackResponse$.outboundSchema = GetAllFeedbackResponse$outboundSchema;
})(GetAllFeedbackResponse$ || (GetAllFeedbackResponse$ = {}));
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