"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.documentsFilesSearchRequestDtoFromJSON = exports.documentsFilesSearchRequestDtoToJSON = exports.DocumentsFilesSearchRequestDto$ = exports.DocumentsFilesSearchRequestDto$outboundSchema = exports.DocumentsFilesSearchRequestDto$inboundSchema = exports.paramsFromJSON = exports.paramsToJSON = exports.Params$ = exports.Params$outboundSchema = exports.Params$inboundSchema = exports.filterFromJSON = exports.filterToJSON = exports.Filter$ = exports.Filter$outboundSchema = exports.Filter$inboundSchema = exports.operationTypeFromJSON = exports.operationTypeToJSON = exports.OperationType$ = exports.OperationType$outboundSchema = exports.OperationType$inboundSchema = exports.DocumentsFilesSearchRequestDtoValue$ = exports.DocumentsFilesSearchRequestDtoValue$outboundSchema = exports.DocumentsFilesSearchRequestDtoValue$inboundSchema = exports.documentsFilesSearchRequestDtoSourceValueFromJSON = exports.documentsFilesSearchRequestDtoSourceValueToJSON = exports.DocumentsFilesSearchRequestDtoSourceValue$ = exports.DocumentsFilesSearchRequestDtoSourceValue$outboundSchema = exports.DocumentsFilesSearchRequestDtoSourceValue$inboundSchema = exports.documentsFilesSearchRequestDto4FromJSON = exports.documentsFilesSearchRequestDto4ToJSON = exports.DocumentsFilesSearchRequestDto4$ = exports.DocumentsFilesSearchRequestDto4$outboundSchema = exports.DocumentsFilesSearchRequestDto4$inboundSchema = exports.DocumentsFilesSearchRequestDtoValue = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const enums_js_1 = require("../../types/enums.js");
/**
 * The operation type of the query
 */
var DocumentsFilesSearchRequestDtoValue;
(function (DocumentsFilesSearchRequestDtoValue) {
    DocumentsFilesSearchRequestDtoValue["Contains"] = "contains";
    DocumentsFilesSearchRequestDtoValue["Equals"] = "equals";
    DocumentsFilesSearchRequestDtoValue["NotEquals"] = "not_equals";
    DocumentsFilesSearchRequestDtoValue["UnmappedValue"] = "unmapped_value";
})(DocumentsFilesSearchRequestDtoValue || (exports.DocumentsFilesSearchRequestDtoValue = DocumentsFilesSearchRequestDtoValue = {}));
/** @internal */
exports.DocumentsFilesSearchRequestDto4$inboundSchema = z.object({});
/** @internal */
exports.DocumentsFilesSearchRequestDto4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var DocumentsFilesSearchRequestDto4$;
(function (DocumentsFilesSearchRequestDto4$) {
    /** @deprecated use `DocumentsFilesSearchRequestDto4$inboundSchema` instead. */
    DocumentsFilesSearchRequestDto4$.inboundSchema = exports.DocumentsFilesSearchRequestDto4$inboundSchema;
    /** @deprecated use `DocumentsFilesSearchRequestDto4$outboundSchema` instead. */
    DocumentsFilesSearchRequestDto4$.outboundSchema = exports.DocumentsFilesSearchRequestDto4$outboundSchema;
})(DocumentsFilesSearchRequestDto4$ || (exports.DocumentsFilesSearchRequestDto4$ = DocumentsFilesSearchRequestDto4$ = {}));
function documentsFilesSearchRequestDto4ToJSON(documentsFilesSearchRequestDto4) {
    return JSON.stringify(exports.DocumentsFilesSearchRequestDto4$outboundSchema.parse(documentsFilesSearchRequestDto4));
}
exports.documentsFilesSearchRequestDto4ToJSON = documentsFilesSearchRequestDto4ToJSON;
function documentsFilesSearchRequestDto4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DocumentsFilesSearchRequestDto4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DocumentsFilesSearchRequestDto4' from JSON`);
}
exports.documentsFilesSearchRequestDto4FromJSON = documentsFilesSearchRequestDto4FromJSON;
/** @internal */
exports.DocumentsFilesSearchRequestDtoSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.DocumentsFilesSearchRequestDto4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.DocumentsFilesSearchRequestDtoSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.DocumentsFilesSearchRequestDto4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var DocumentsFilesSearchRequestDtoSourceValue$;
(function (DocumentsFilesSearchRequestDtoSourceValue$) {
    /** @deprecated use `DocumentsFilesSearchRequestDtoSourceValue$inboundSchema` instead. */
    DocumentsFilesSearchRequestDtoSourceValue$.inboundSchema = exports.DocumentsFilesSearchRequestDtoSourceValue$inboundSchema;
    /** @deprecated use `DocumentsFilesSearchRequestDtoSourceValue$outboundSchema` instead. */
    DocumentsFilesSearchRequestDtoSourceValue$.outboundSchema = exports.DocumentsFilesSearchRequestDtoSourceValue$outboundSchema;
})(DocumentsFilesSearchRequestDtoSourceValue$ || (exports.DocumentsFilesSearchRequestDtoSourceValue$ = DocumentsFilesSearchRequestDtoSourceValue$ = {}));
function documentsFilesSearchRequestDtoSourceValueToJSON(documentsFilesSearchRequestDtoSourceValue) {
    return JSON.stringify(exports.DocumentsFilesSearchRequestDtoSourceValue$outboundSchema.parse(documentsFilesSearchRequestDtoSourceValue));
}
exports.documentsFilesSearchRequestDtoSourceValueToJSON = documentsFilesSearchRequestDtoSourceValueToJSON;
function documentsFilesSearchRequestDtoSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DocumentsFilesSearchRequestDtoSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DocumentsFilesSearchRequestDtoSourceValue' from JSON`);
}
exports.documentsFilesSearchRequestDtoSourceValueFromJSON = documentsFilesSearchRequestDtoSourceValueFromJSON;
/** @internal */
exports.DocumentsFilesSearchRequestDtoValue$inboundSchema = z
    .union([
    z.nativeEnum(DocumentsFilesSearchRequestDtoValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.DocumentsFilesSearchRequestDtoValue$outboundSchema = z.union([
    z.nativeEnum(DocumentsFilesSearchRequestDtoValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var DocumentsFilesSearchRequestDtoValue$;
(function (DocumentsFilesSearchRequestDtoValue$) {
    /** @deprecated use `DocumentsFilesSearchRequestDtoValue$inboundSchema` instead. */
    DocumentsFilesSearchRequestDtoValue$.inboundSchema = exports.DocumentsFilesSearchRequestDtoValue$inboundSchema;
    /** @deprecated use `DocumentsFilesSearchRequestDtoValue$outboundSchema` instead. */
    DocumentsFilesSearchRequestDtoValue$.outboundSchema = exports.DocumentsFilesSearchRequestDtoValue$outboundSchema;
})(DocumentsFilesSearchRequestDtoValue$ || (exports.DocumentsFilesSearchRequestDtoValue$ = DocumentsFilesSearchRequestDtoValue$ = {}));
/** @internal */
exports.OperationType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.DocumentsFilesSearchRequestDto4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.DocumentsFilesSearchRequestDtoValue$inboundSchema.default(DocumentsFilesSearchRequestDtoValue.Contains)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.OperationType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.DocumentsFilesSearchRequestDto4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.DocumentsFilesSearchRequestDtoValue$outboundSchema.default(DocumentsFilesSearchRequestDtoValue.Contains)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var OperationType$;
(function (OperationType$) {
    /** @deprecated use `OperationType$inboundSchema` instead. */
    OperationType$.inboundSchema = exports.OperationType$inboundSchema;
    /** @deprecated use `OperationType$outboundSchema` instead. */
    OperationType$.outboundSchema = exports.OperationType$outboundSchema;
})(OperationType$ || (exports.OperationType$ = OperationType$ = {}));
function operationTypeToJSON(operationType) {
    return JSON.stringify(exports.OperationType$outboundSchema.parse(operationType));
}
exports.operationTypeToJSON = operationTypeToJSON;
function operationTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.OperationType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OperationType' from JSON`);
}
exports.operationTypeFromJSON = operationTypeFromJSON;
/** @internal */
exports.Filter$inboundSchema = z
    .object({
    updated_after: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "updated_after": "updatedAfter",
    });
});
/** @internal */
exports.Filter$outboundSchema = z.object({
    updatedAfter: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        updatedAfter: "updated_after",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Filter$;
(function (Filter$) {
    /** @deprecated use `Filter$inboundSchema` instead. */
    Filter$.inboundSchema = exports.Filter$inboundSchema;
    /** @deprecated use `Filter$outboundSchema` instead. */
    Filter$.outboundSchema = exports.Filter$outboundSchema;
})(Filter$ || (exports.Filter$ = Filter$ = {}));
function filterToJSON(filter) {
    return JSON.stringify(exports.Filter$outboundSchema.parse(filter));
}
exports.filterToJSON = filterToJSON;
function filterFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Filter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Filter' from JSON`);
}
exports.filterFromJSON = filterFromJSON;
/** @internal */
exports.Params$inboundSchema = z
    .object({
    fields: z.nullable(z.string()).optional(),
    filter: z.nullable(z.lazy(() => exports.Filter$inboundSchema)).optional(),
    next: z.nullable(z.string()).optional(),
    page: z.nullable(z.string()).optional(),
    page_size: z.nullable(z.string()).optional(),
    raw: z.nullable(z.boolean()).optional(),
    updated_after: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "page_size": "pageSize",
        "updated_after": "updatedAfter",
    });
});
/** @internal */
exports.Params$outboundSchema = z.object({
    fields: z.nullable(z.string()).optional(),
    filter: z.nullable(z.lazy(() => exports.Filter$outboundSchema)).optional(),
    next: z.nullable(z.string()).optional(),
    page: z.nullable(z.string()).optional(),
    pageSize: z.nullable(z.string()).optional(),
    raw: z.nullable(z.boolean()).optional(),
    updatedAfter: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        pageSize: "page_size",
        updatedAfter: "updated_after",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Params$;
(function (Params$) {
    /** @deprecated use `Params$inboundSchema` instead. */
    Params$.inboundSchema = exports.Params$inboundSchema;
    /** @deprecated use `Params$outboundSchema` instead. */
    Params$.outboundSchema = exports.Params$outboundSchema;
})(Params$ || (exports.Params$ = Params$ = {}));
function paramsToJSON(params) {
    return JSON.stringify(exports.Params$outboundSchema.parse(params));
}
exports.paramsToJSON = paramsToJSON;
function paramsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Params$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Params' from JSON`);
}
exports.paramsFromJSON = paramsFromJSON;
/** @internal */
exports.DocumentsFilesSearchRequestDto$inboundSchema = z.object({
    field: z.nullable(z.string()).optional(),
    operation_type: z.nullable(z.lazy(() => exports.OperationType$inboundSchema))
        .optional(),
    params: z.nullable(z.lazy(() => exports.Params$inboundSchema)).optional(),
    passthrough: z.nullable(z.record(z.any())).optional(),
    query: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "operation_type": "operationType",
    });
});
/** @internal */
exports.DocumentsFilesSearchRequestDto$outboundSchema = z.object({
    field: z.nullable(z.string()).optional(),
    operationType: z.nullable(z.lazy(() => exports.OperationType$outboundSchema))
        .optional(),
    params: z.nullable(z.lazy(() => exports.Params$outboundSchema)).optional(),
    passthrough: z.nullable(z.record(z.any())).optional(),
    query: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        operationType: "operation_type",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var DocumentsFilesSearchRequestDto$;
(function (DocumentsFilesSearchRequestDto$) {
    /** @deprecated use `DocumentsFilesSearchRequestDto$inboundSchema` instead. */
    DocumentsFilesSearchRequestDto$.inboundSchema = exports.DocumentsFilesSearchRequestDto$inboundSchema;
    /** @deprecated use `DocumentsFilesSearchRequestDto$outboundSchema` instead. */
    DocumentsFilesSearchRequestDto$.outboundSchema = exports.DocumentsFilesSearchRequestDto$outboundSchema;
})(DocumentsFilesSearchRequestDto$ || (exports.DocumentsFilesSearchRequestDto$ = DocumentsFilesSearchRequestDto$ = {}));
function documentsFilesSearchRequestDtoToJSON(documentsFilesSearchRequestDto) {
    return JSON.stringify(exports.DocumentsFilesSearchRequestDto$outboundSchema.parse(documentsFilesSearchRequestDto));
}
exports.documentsFilesSearchRequestDtoToJSON = documentsFilesSearchRequestDtoToJSON;
function documentsFilesSearchRequestDtoFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DocumentsFilesSearchRequestDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DocumentsFilesSearchRequestDto' from JSON`);
}
exports.documentsFilesSearchRequestDtoFromJSON = documentsFilesSearchRequestDtoFromJSON;
//# sourceMappingURL=documentsfilessearchrequestdto.js.map