"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.LogFeedbackResponseBody$outboundSchema = exports.LogFeedbackResponseBody$inboundSchema = exports.LogFeedbackSources$outboundSchema = exports.LogFeedbackSources$inboundSchema = exports.LogFeedbackFeedbackResponseType$outboundSchema = exports.LogFeedbackFeedbackResponseType$inboundSchema = exports.LogFeedbackUserProperties$outboundSchema = exports.LogFeedbackUserProperties$inboundSchema = exports.LogFeedbackUserId$outboundSchema = exports.LogFeedbackUserId$inboundSchema = exports.LogFeedbackId$outboundSchema = exports.LogFeedbackId$inboundSchema = exports.LogFeedbackReasons$outboundSchema = exports.LogFeedbackReasons$inboundSchema = exports.LogFeedbackFeedbackType$outboundSchema = exports.LogFeedbackFeedbackType$inboundSchema = exports.LogFeedbackRequestBody$outboundSchema = exports.LogFeedbackRequestBody$inboundSchema = exports.Sources$outboundSchema = exports.Sources$inboundSchema = exports.LogFeedbackType$outboundSchema = exports.LogFeedbackType$inboundSchema = exports.UserProperties$outboundSchema = exports.UserProperties$inboundSchema = exports.UserId$outboundSchema = exports.UserId$inboundSchema = exports.Id$outboundSchema = exports.Id$inboundSchema = exports.Reasons$outboundSchema = exports.Reasons$inboundSchema = exports.Type$outboundSchema = exports.Type$inboundSchema = exports.LogFeedbackFeedbackResponseType = exports.LogFeedbackFeedbackType = exports.LogFeedbackType = 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.sourcesToJSON = sourcesToJSON;
exports.sourcesFromJSON = sourcesFromJSON;
exports.logFeedbackRequestBodyToJSON = logFeedbackRequestBodyToJSON;
exports.logFeedbackRequestBodyFromJSON = logFeedbackRequestBodyFromJSON;
exports.logFeedbackReasonsToJSON = logFeedbackReasonsToJSON;
exports.logFeedbackReasonsFromJSON = logFeedbackReasonsFromJSON;
exports.logFeedbackIdToJSON = logFeedbackIdToJSON;
exports.logFeedbackIdFromJSON = logFeedbackIdFromJSON;
exports.logFeedbackUserIdToJSON = logFeedbackUserIdToJSON;
exports.logFeedbackUserIdFromJSON = logFeedbackUserIdFromJSON;
exports.logFeedbackUserPropertiesToJSON = logFeedbackUserPropertiesToJSON;
exports.logFeedbackUserPropertiesFromJSON = logFeedbackUserPropertiesFromJSON;
exports.logFeedbackSourcesToJSON = logFeedbackSourcesToJSON;
exports.logFeedbackSourcesFromJSON = logFeedbackSourcesFromJSON;
exports.logFeedbackResponseBodyToJSON = logFeedbackResponseBodyToJSON;
exports.logFeedbackResponseBodyFromJSON = logFeedbackResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.Type = {
    Positive: "positive",
    Negative: "negative",
};
exports.LogFeedbackType = {
    Positive: "positive",
    Negative: "negative",
    New: "new",
};
exports.LogFeedbackFeedbackType = {
    Positive: "positive",
    Negative: "negative",
};
exports.LogFeedbackFeedbackResponseType = {
    Positive: "positive",
    Negative: "negative",
    New: "new",
};
/** @internal */
exports.Type$inboundSchema = z.nativeEnum(exports.Type);
/** @internal */
exports.Type$outboundSchema = exports.Type$inboundSchema;
/** @internal */
exports.Reasons$inboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/** @internal */
exports.Reasons$outboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
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()]);
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()]);
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(),
    userType: 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(),
    userType: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
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.LogFeedbackType$inboundSchema = z.nativeEnum(exports.LogFeedbackType);
/** @internal */
exports.LogFeedbackType$outboundSchema = exports.LogFeedbackType$inboundSchema;
/** @internal */
exports.Sources$inboundSchema = z.object({
    type: z.nullable(exports.LogFeedbackType$inboundSchema),
    title: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
/** @internal */
exports.Sources$outboundSchema = z.object({
    type: z.nullable(exports.LogFeedbackType$outboundSchema),
    title: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
function sourcesToJSON(sources) {
    return JSON.stringify(exports.Sources$outboundSchema.parse(sources));
}
function sourcesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Sources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Sources' from JSON`);
}
/** @internal */
exports.LogFeedbackRequestBody$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(),
    updatedAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    reasons: z.nullable(z.array(z.lazy(() => exports.Reasons$inboundSchema))).optional(),
    details: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.UserProperties$inboundSchema))
        .optional(),
    sources: z.nullable(z.array(z.lazy(() => exports.Sources$inboundSchema))).optional(),
});
/** @internal */
exports.LogFeedbackRequestBody$outboundSchema = z.object({
    id: z.string().optional(),
    type: exports.Type$outboundSchema,
    messageId: z.string(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    reasons: z.nullable(z.array(z.lazy(() => exports.Reasons$outboundSchema))).optional(),
    details: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.UserProperties$outboundSchema))
        .optional(),
    sources: z.nullable(z.array(z.lazy(() => exports.Sources$outboundSchema))).optional(),
});
function logFeedbackRequestBodyToJSON(logFeedbackRequestBody) {
    return JSON.stringify(exports.LogFeedbackRequestBody$outboundSchema.parse(logFeedbackRequestBody));
}
function logFeedbackRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LogFeedbackRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LogFeedbackRequestBody' from JSON`);
}
/** @internal */
exports.LogFeedbackFeedbackType$inboundSchema = z.nativeEnum(exports.LogFeedbackFeedbackType);
/** @internal */
exports.LogFeedbackFeedbackType$outboundSchema = exports.LogFeedbackFeedbackType$inboundSchema;
/** @internal */
exports.LogFeedbackReasons$inboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
/** @internal */
exports.LogFeedbackReasons$outboundSchema = z.object({
    label: z.string(),
    details: z.string(),
});
function logFeedbackReasonsToJSON(logFeedbackReasons) {
    return JSON.stringify(exports.LogFeedbackReasons$outboundSchema.parse(logFeedbackReasons));
}
function logFeedbackReasonsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LogFeedbackReasons$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LogFeedbackReasons' from JSON`);
}
/** @internal */
exports.LogFeedbackId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.LogFeedbackId$outboundSchema = z.union([z.string(), z.number()]);
function logFeedbackIdToJSON(logFeedbackId) {
    return JSON.stringify(exports.LogFeedbackId$outboundSchema.parse(logFeedbackId));
}
function logFeedbackIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LogFeedbackId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LogFeedbackId' from JSON`);
}
/** @internal */
exports.LogFeedbackUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.LogFeedbackUserId$outboundSchema = z.union([z.string(), z.number()]);
function logFeedbackUserIdToJSON(logFeedbackUserId) {
    return JSON.stringify(exports.LogFeedbackUserId$outboundSchema.parse(logFeedbackUserId));
}
function logFeedbackUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LogFeedbackUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LogFeedbackUserId' from JSON`);
}
/** @internal */
exports.LogFeedbackUserProperties$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(),
    userType: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
exports.LogFeedbackUserProperties$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,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
function logFeedbackUserPropertiesToJSON(logFeedbackUserProperties) {
    return JSON.stringify(exports.LogFeedbackUserProperties$outboundSchema.parse(logFeedbackUserProperties));
}
function logFeedbackUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LogFeedbackUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LogFeedbackUserProperties' from JSON`);
}
/** @internal */
exports.LogFeedbackFeedbackResponseType$inboundSchema = z.nativeEnum(exports.LogFeedbackFeedbackResponseType);
/** @internal */
exports.LogFeedbackFeedbackResponseType$outboundSchema = exports.LogFeedbackFeedbackResponseType$inboundSchema;
/** @internal */
exports.LogFeedbackSources$inboundSchema = z.object({
    type: z.nullable(exports.LogFeedbackFeedbackResponseType$inboundSchema),
    title: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
/** @internal */
exports.LogFeedbackSources$outboundSchema = z.object({
    type: z.nullable(exports.LogFeedbackFeedbackResponseType$outboundSchema),
    title: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
});
function logFeedbackSourcesToJSON(logFeedbackSources) {
    return JSON.stringify(exports.LogFeedbackSources$outboundSchema.parse(logFeedbackSources));
}
function logFeedbackSourcesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LogFeedbackSources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LogFeedbackSources' from JSON`);
}
/** @internal */
exports.LogFeedbackResponseBody$inboundSchema = z.object({
    id: z.string(),
    type: exports.LogFeedbackFeedbackType$inboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => exports.LogFeedbackReasons$inboundSchema)))
        .optional(),
    details: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.LogFeedbackUserProperties$inboundSchema)).optional(),
    sources: z.nullable(z.array(z.lazy(() => exports.LogFeedbackSources$inboundSchema)))
        .optional(),
});
/** @internal */
exports.LogFeedbackResponseBody$outboundSchema = z.object({
    id: z.string(),
    type: exports.LogFeedbackFeedbackType$outboundSchema,
    messageId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    reasons: z.nullable(z.array(z.lazy(() => exports.LogFeedbackReasons$outboundSchema)))
        .optional(),
    details: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.LogFeedbackUserProperties$outboundSchema)).optional(),
    sources: z.nullable(z.array(z.lazy(() => exports.LogFeedbackSources$outboundSchema)))
        .optional(),
});
function logFeedbackResponseBodyToJSON(logFeedbackResponseBody) {
    return JSON.stringify(exports.LogFeedbackResponseBody$outboundSchema.parse(logFeedbackResponseBody));
}
function logFeedbackResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LogFeedbackResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LogFeedbackResponseBody' from JSON`);
}
//# sourceMappingURL=logfeedback.js.map