/*
 * 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";
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 Id$inboundSchema = z.union([
    z.string(),
    z.number(),
]);
/** @internal */
export const Id$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 Id$;
(function (Id$) {
    /** @deprecated use `Id$inboundSchema` instead. */
    Id$.inboundSchema = Id$inboundSchema;
    /** @deprecated use `Id$outboundSchema` instead. */
    Id$.outboundSchema = Id$outboundSchema;
})(Id$ || (Id$ = {}));
export function idToJSON(id) {
    return JSON.stringify(Id$outboundSchema.parse(id));
}
export function idFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Id$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Id' from JSON`);
}
/** @internal */
export const UserId$inboundSchema = z
    .union([z.string(), z.number()]);
/** @internal */
export const UserId$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 UserId$;
(function (UserId$) {
    /** @deprecated use `UserId$inboundSchema` instead. */
    UserId$.inboundSchema = UserId$inboundSchema;
    /** @deprecated use `UserId$outboundSchema` instead. */
    UserId$.outboundSchema = UserId$outboundSchema;
})(UserId$ || (UserId$ = {}));
export function userIdToJSON(userId) {
    return JSON.stringify(UserId$outboundSchema.parse(userId));
}
export function userIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserId' from JSON`);
}
/** @internal */
export const UserProperties$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 UserProperties$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 UserProperties$;
(function (UserProperties$) {
    /** @deprecated use `UserProperties$inboundSchema` instead. */
    UserProperties$.inboundSchema = UserProperties$inboundSchema;
    /** @deprecated use `UserProperties$outboundSchema` instead. */
    UserProperties$.outboundSchema = UserProperties$outboundSchema;
})(UserProperties$ || (UserProperties$ = {}));
export function userPropertiesToJSON(userProperties) {
    return JSON.stringify(UserProperties$outboundSchema.parse(userProperties));
}
export function userPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserProperties' 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(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => UserProperties$inboundSchema))
        .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(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => UserProperties$outboundSchema))
        .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 SubmitFeedbackId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SubmitFeedbackId$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 SubmitFeedbackId$;
(function (SubmitFeedbackId$) {
    /** @deprecated use `SubmitFeedbackId$inboundSchema` instead. */
    SubmitFeedbackId$.inboundSchema = SubmitFeedbackId$inboundSchema;
    /** @deprecated use `SubmitFeedbackId$outboundSchema` instead. */
    SubmitFeedbackId$.outboundSchema = SubmitFeedbackId$outboundSchema;
})(SubmitFeedbackId$ || (SubmitFeedbackId$ = {}));
export function submitFeedbackIdToJSON(submitFeedbackId) {
    return JSON.stringify(SubmitFeedbackId$outboundSchema.parse(submitFeedbackId));
}
export function submitFeedbackIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SubmitFeedbackId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackId' from JSON`);
}
/** @internal */
export const SubmitFeedbackUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SubmitFeedbackUserId$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 SubmitFeedbackUserId$;
(function (SubmitFeedbackUserId$) {
    /** @deprecated use `SubmitFeedbackUserId$inboundSchema` instead. */
    SubmitFeedbackUserId$.inboundSchema = SubmitFeedbackUserId$inboundSchema;
    /** @deprecated use `SubmitFeedbackUserId$outboundSchema` instead. */
    SubmitFeedbackUserId$.outboundSchema = SubmitFeedbackUserId$outboundSchema;
})(SubmitFeedbackUserId$ || (SubmitFeedbackUserId$ = {}));
export function submitFeedbackUserIdToJSON(submitFeedbackUserId) {
    return JSON.stringify(SubmitFeedbackUserId$outboundSchema.parse(submitFeedbackUserId));
}
export function submitFeedbackUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SubmitFeedbackUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackUserId' from JSON`);
}
/** @internal */
export const SubmitFeedbackUserProperties$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 SubmitFeedbackUserProperties$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 SubmitFeedbackUserProperties$;
(function (SubmitFeedbackUserProperties$) {
    /** @deprecated use `SubmitFeedbackUserProperties$inboundSchema` instead. */
    SubmitFeedbackUserProperties$.inboundSchema = SubmitFeedbackUserProperties$inboundSchema;
    /** @deprecated use `SubmitFeedbackUserProperties$outboundSchema` instead. */
    SubmitFeedbackUserProperties$.outboundSchema = SubmitFeedbackUserProperties$outboundSchema;
})(SubmitFeedbackUserProperties$ || (SubmitFeedbackUserProperties$ = {}));
export function submitFeedbackUserPropertiesToJSON(submitFeedbackUserProperties) {
    return JSON.stringify(SubmitFeedbackUserProperties$outboundSchema.parse(submitFeedbackUserProperties));
}
export function submitFeedbackUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SubmitFeedbackUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackUserProperties' 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(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => SubmitFeedbackUserProperties$inboundSchema)).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(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => SubmitFeedbackUserProperties$outboundSchema)).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