"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SubmitFeedbackResponseBody$ = exports.SubmitFeedbackResponseBody$outboundSchema = exports.SubmitFeedbackResponseBody$inboundSchema = exports.SubmitFeedbackUserProperties$ = exports.SubmitFeedbackUserProperties$outboundSchema = exports.SubmitFeedbackUserProperties$inboundSchema = exports.SubmitFeedbackUserId$ = exports.SubmitFeedbackUserId$outboundSchema = exports.SubmitFeedbackUserId$inboundSchema = exports.SubmitFeedbackId$ = exports.SubmitFeedbackId$outboundSchema = exports.SubmitFeedbackId$inboundSchema = exports.SubmitFeedbackReasons$ = exports.SubmitFeedbackReasons$outboundSchema = exports.SubmitFeedbackReasons$inboundSchema = exports.SubmitFeedbackType$ = exports.SubmitFeedbackType$outboundSchema = exports.SubmitFeedbackType$inboundSchema = exports.SubmitFeedbackRequestBody$ = exports.SubmitFeedbackRequestBody$outboundSchema = exports.SubmitFeedbackRequestBody$inboundSchema = exports.UserProperties$ = exports.UserProperties$outboundSchema = exports.UserProperties$inboundSchema = exports.UserId$ = exports.UserId$outboundSchema = exports.UserId$inboundSchema = exports.Id$ = exports.Id$outboundSchema = exports.Id$inboundSchema = exports.Reasons$ = exports.Reasons$outboundSchema = exports.Reasons$inboundSchema = exports.Type$ = exports.Type$outboundSchema = exports.Type$inboundSchema = exports.SubmitFeedbackType = exports.Type = void 0;
exports.reasonsToJSON = reasonsToJSON;
exports.reasonsFromJSON = reasonsFromJSON;
exports.idToJSON = idToJSON;
exports.idFromJSON = idFromJSON;
exports.userIdToJSON = userIdToJSON;
exports.userIdFromJSON = userIdFromJSON;
exports.userPropertiesToJSON = userPropertiesToJSON;
exports.userPropertiesFromJSON = userPropertiesFromJSON;
exports.submitFeedbackRequestBodyToJSON = submitFeedbackRequestBodyToJSON;
exports.submitFeedbackRequestBodyFromJSON = submitFeedbackRequestBodyFromJSON;
exports.submitFeedbackReasonsToJSON = submitFeedbackReasonsToJSON;
exports.submitFeedbackReasonsFromJSON = submitFeedbackReasonsFromJSON;
exports.submitFeedbackIdToJSON = submitFeedbackIdToJSON;
exports.submitFeedbackIdFromJSON = submitFeedbackIdFromJSON;
exports.submitFeedbackUserIdToJSON = submitFeedbackUserIdToJSON;
exports.submitFeedbackUserIdFromJSON = submitFeedbackUserIdFromJSON;
exports.submitFeedbackUserPropertiesToJSON = submitFeedbackUserPropertiesToJSON;
exports.submitFeedbackUserPropertiesFromJSON = submitFeedbackUserPropertiesFromJSON;
exports.submitFeedbackResponseBodyToJSON = submitFeedbackResponseBodyToJSON;
exports.submitFeedbackResponseBodyFromJSON = submitFeedbackResponseBodyFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.Type = {
    Positive: "positive",
    Negative: "negative",
};
exports.SubmitFeedbackType = {
    Positive: "positive",
    Negative: "negative",
};
/** @internal */
exports.Type$inboundSchema = z.nativeEnum(exports.Type);
/** @internal */
exports.Type$outboundSchema = exports.Type$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Type$;
(function (Type$) {
    /** @deprecated use `Type$inboundSchema` instead. */
    Type$.inboundSchema = exports.Type$inboundSchema;
    /** @deprecated use `Type$outboundSchema` instead. */
    Type$.outboundSchema = exports.Type$outboundSchema;
})(Type$ || (exports.Type$ = Type$ = {}));
/** @internal */
exports.Reasons$inboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/** @internal */
exports.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.
 */
var Reasons$;
(function (Reasons$) {
    /** @deprecated use `Reasons$inboundSchema` instead. */
    Reasons$.inboundSchema = exports.Reasons$inboundSchema;
    /** @deprecated use `Reasons$outboundSchema` instead. */
    Reasons$.outboundSchema = exports.Reasons$outboundSchema;
})(Reasons$ || (exports.Reasons$ = Reasons$ = {}));
function reasonsToJSON(reasons) {
    return JSON.stringify(exports.Reasons$outboundSchema.parse(reasons));
}
function reasonsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Reasons$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Reasons' from JSON`);
}
/** @internal */
exports.Id$inboundSchema = z.union([
    z.string(),
    z.number(),
]);
/** @internal */
exports.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.
 */
var Id$;
(function (Id$) {
    /** @deprecated use `Id$inboundSchema` instead. */
    Id$.inboundSchema = exports.Id$inboundSchema;
    /** @deprecated use `Id$outboundSchema` instead. */
    Id$.outboundSchema = exports.Id$outboundSchema;
})(Id$ || (exports.Id$ = Id$ = {}));
function idToJSON(id) {
    return JSON.stringify(exports.Id$outboundSchema.parse(id));
}
function idFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Id$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Id' from JSON`);
}
/** @internal */
exports.UserId$inboundSchema = z
    .union([z.string(), z.number()]);
/** @internal */
exports.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.
 */
var UserId$;
(function (UserId$) {
    /** @deprecated use `UserId$inboundSchema` instead. */
    UserId$.inboundSchema = exports.UserId$inboundSchema;
    /** @deprecated use `UserId$outboundSchema` instead. */
    UserId$.outboundSchema = exports.UserId$outboundSchema;
})(UserId$ || (exports.UserId$ = UserId$ = {}));
function userIdToJSON(userId) {
    return JSON.stringify(exports.UserId$outboundSchema.parse(userId));
}
function userIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserId' from JSON`);
}
/** @internal */
exports.UserProperties$inboundSchema = (0, schemas_js_1.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 */
exports.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,
        ...(0, primitives_js_1.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.
 */
var UserProperties$;
(function (UserProperties$) {
    /** @deprecated use `UserProperties$inboundSchema` instead. */
    UserProperties$.inboundSchema = exports.UserProperties$inboundSchema;
    /** @deprecated use `UserProperties$outboundSchema` instead. */
    UserProperties$.outboundSchema = exports.UserProperties$outboundSchema;
})(UserProperties$ || (exports.UserProperties$ = UserProperties$ = {}));
function userPropertiesToJSON(userProperties) {
    return JSON.stringify(exports.UserProperties$outboundSchema.parse(userProperties));
}
function userPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserProperties' from JSON`);
}
/** @internal */
exports.SubmitFeedbackRequestBody$inboundSchema = z.object({
    id: z.string().optional(),
    type: exports.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(() => exports.Reasons$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.UserProperties$inboundSchema))
        .optional(),
});
/** @internal */
exports.SubmitFeedbackRequestBody$outboundSchema = z.object({
    id: z.string().optional(),
    type: exports.Type$outboundSchema,
    messageId: z.string(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    reasons: z.nullable(z.array(z.lazy(() => exports.Reasons$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.UserProperties$outboundSchema))
        .optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SubmitFeedbackRequestBody$;
(function (SubmitFeedbackRequestBody$) {
    /** @deprecated use `SubmitFeedbackRequestBody$inboundSchema` instead. */
    SubmitFeedbackRequestBody$.inboundSchema = exports.SubmitFeedbackRequestBody$inboundSchema;
    /** @deprecated use `SubmitFeedbackRequestBody$outboundSchema` instead. */
    SubmitFeedbackRequestBody$.outboundSchema = exports.SubmitFeedbackRequestBody$outboundSchema;
})(SubmitFeedbackRequestBody$ || (exports.SubmitFeedbackRequestBody$ = SubmitFeedbackRequestBody$ = {}));
function submitFeedbackRequestBodyToJSON(submitFeedbackRequestBody) {
    return JSON.stringify(exports.SubmitFeedbackRequestBody$outboundSchema.parse(submitFeedbackRequestBody));
}
function submitFeedbackRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SubmitFeedbackRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackRequestBody' from JSON`);
}
/** @internal */
exports.SubmitFeedbackType$inboundSchema = z.nativeEnum(exports.SubmitFeedbackType);
/** @internal */
exports.SubmitFeedbackType$outboundSchema = exports.SubmitFeedbackType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SubmitFeedbackType$;
(function (SubmitFeedbackType$) {
    /** @deprecated use `SubmitFeedbackType$inboundSchema` instead. */
    SubmitFeedbackType$.inboundSchema = exports.SubmitFeedbackType$inboundSchema;
    /** @deprecated use `SubmitFeedbackType$outboundSchema` instead. */
    SubmitFeedbackType$.outboundSchema = exports.SubmitFeedbackType$outboundSchema;
})(SubmitFeedbackType$ || (exports.SubmitFeedbackType$ = SubmitFeedbackType$ = {}));
/** @internal */
exports.SubmitFeedbackReasons$inboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/** @internal */
exports.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.
 */
var SubmitFeedbackReasons$;
(function (SubmitFeedbackReasons$) {
    /** @deprecated use `SubmitFeedbackReasons$inboundSchema` instead. */
    SubmitFeedbackReasons$.inboundSchema = exports.SubmitFeedbackReasons$inboundSchema;
    /** @deprecated use `SubmitFeedbackReasons$outboundSchema` instead. */
    SubmitFeedbackReasons$.outboundSchema = exports.SubmitFeedbackReasons$outboundSchema;
})(SubmitFeedbackReasons$ || (exports.SubmitFeedbackReasons$ = SubmitFeedbackReasons$ = {}));
function submitFeedbackReasonsToJSON(submitFeedbackReasons) {
    return JSON.stringify(exports.SubmitFeedbackReasons$outboundSchema.parse(submitFeedbackReasons));
}
function submitFeedbackReasonsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SubmitFeedbackReasons$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackReasons' from JSON`);
}
/** @internal */
exports.SubmitFeedbackId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.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.
 */
var SubmitFeedbackId$;
(function (SubmitFeedbackId$) {
    /** @deprecated use `SubmitFeedbackId$inboundSchema` instead. */
    SubmitFeedbackId$.inboundSchema = exports.SubmitFeedbackId$inboundSchema;
    /** @deprecated use `SubmitFeedbackId$outboundSchema` instead. */
    SubmitFeedbackId$.outboundSchema = exports.SubmitFeedbackId$outboundSchema;
})(SubmitFeedbackId$ || (exports.SubmitFeedbackId$ = SubmitFeedbackId$ = {}));
function submitFeedbackIdToJSON(submitFeedbackId) {
    return JSON.stringify(exports.SubmitFeedbackId$outboundSchema.parse(submitFeedbackId));
}
function submitFeedbackIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SubmitFeedbackId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackId' from JSON`);
}
/** @internal */
exports.SubmitFeedbackUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.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.
 */
var SubmitFeedbackUserId$;
(function (SubmitFeedbackUserId$) {
    /** @deprecated use `SubmitFeedbackUserId$inboundSchema` instead. */
    SubmitFeedbackUserId$.inboundSchema = exports.SubmitFeedbackUserId$inboundSchema;
    /** @deprecated use `SubmitFeedbackUserId$outboundSchema` instead. */
    SubmitFeedbackUserId$.outboundSchema = exports.SubmitFeedbackUserId$outboundSchema;
})(SubmitFeedbackUserId$ || (exports.SubmitFeedbackUserId$ = SubmitFeedbackUserId$ = {}));
function submitFeedbackUserIdToJSON(submitFeedbackUserId) {
    return JSON.stringify(exports.SubmitFeedbackUserId$outboundSchema.parse(submitFeedbackUserId));
}
function submitFeedbackUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SubmitFeedbackUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackUserId' from JSON`);
}
/** @internal */
exports.SubmitFeedbackUserProperties$inboundSchema = (0, schemas_js_1.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 */
exports.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,
        ...(0, primitives_js_1.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.
 */
var SubmitFeedbackUserProperties$;
(function (SubmitFeedbackUserProperties$) {
    /** @deprecated use `SubmitFeedbackUserProperties$inboundSchema` instead. */
    SubmitFeedbackUserProperties$.inboundSchema = exports.SubmitFeedbackUserProperties$inboundSchema;
    /** @deprecated use `SubmitFeedbackUserProperties$outboundSchema` instead. */
    SubmitFeedbackUserProperties$.outboundSchema = exports.SubmitFeedbackUserProperties$outboundSchema;
})(SubmitFeedbackUserProperties$ || (exports.SubmitFeedbackUserProperties$ = SubmitFeedbackUserProperties$ = {}));
function submitFeedbackUserPropertiesToJSON(submitFeedbackUserProperties) {
    return JSON.stringify(exports.SubmitFeedbackUserProperties$outboundSchema.parse(submitFeedbackUserProperties));
}
function submitFeedbackUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SubmitFeedbackUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackUserProperties' from JSON`);
}
/** @internal */
exports.SubmitFeedbackResponseBody$inboundSchema = z.object({
    id: z.string(),
    type: exports.SubmitFeedbackType$inboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => exports.SubmitFeedbackReasons$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.SubmitFeedbackUserProperties$inboundSchema)).optional(),
});
/** @internal */
exports.SubmitFeedbackResponseBody$outboundSchema = z.object({
    id: z.string(),
    type: exports.SubmitFeedbackType$outboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => exports.SubmitFeedbackReasons$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.SubmitFeedbackUserProperties$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SubmitFeedbackResponseBody$;
(function (SubmitFeedbackResponseBody$) {
    /** @deprecated use `SubmitFeedbackResponseBody$inboundSchema` instead. */
    SubmitFeedbackResponseBody$.inboundSchema = exports.SubmitFeedbackResponseBody$inboundSchema;
    /** @deprecated use `SubmitFeedbackResponseBody$outboundSchema` instead. */
    SubmitFeedbackResponseBody$.outboundSchema = exports.SubmitFeedbackResponseBody$outboundSchema;
})(SubmitFeedbackResponseBody$ || (exports.SubmitFeedbackResponseBody$ = SubmitFeedbackResponseBody$ = {}));
function submitFeedbackResponseBodyToJSON(submitFeedbackResponseBody) {
    return JSON.stringify(exports.SubmitFeedbackResponseBody$outboundSchema.parse(submitFeedbackResponseBody));
}
function submitFeedbackResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SubmitFeedbackResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitFeedbackResponseBody' from JSON`);
}
//# sourceMappingURL=submitfeedback.js.map