"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.SearchParameters$ = exports.SearchParameters$outboundSchema = exports.SearchParameters$inboundSchema = exports.WithField$ = exports.WithField$outboundSchema = exports.WithField$inboundSchema = exports.AggregateUnion$ = exports.AggregateUnion$outboundSchema = exports.AggregateUnion$inboundSchema = exports.AggregateEnum$ = exports.AggregateEnum$outboundSchema = exports.AggregateEnum$inboundSchema = exports.Aggregate$ = exports.Aggregate$outboundSchema = exports.Aggregate$inboundSchema = exports.SearchParametersRange$ = exports.SearchParametersRange$outboundSchema = exports.SearchParametersRange$inboundSchema = exports.SearchParametersType$ = exports.SearchParametersType$outboundSchema = exports.SearchParametersType$inboundSchema = exports.WithField = exports.AggregateEnum = exports.SearchParametersType = void 0;
exports.searchParametersRangeToJSON = searchParametersRangeToJSON;
exports.searchParametersRangeFromJSON = searchParametersRangeFromJSON;
exports.aggregateToJSON = aggregateToJSON;
exports.aggregateFromJSON = aggregateFromJSON;
exports.aggregateUnionToJSON = aggregateUnionToJSON;
exports.aggregateUnionFromJSON = aggregateUnionFromJSON;
exports.searchParametersToJSON = searchParametersToJSON;
exports.searchParametersFromJSON = searchParametersFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.SearchParametersType = {
    Bytes: "bytes",
    ImagePixels: "image_pixels",
    VideoPixels: "video_pixels",
    Duration: "duration",
};
exports.AggregateEnum = {
    Format: "format",
    ResourceType: "resource_type",
    Type: "type",
};
exports.WithField = {
    Context: "context",
    Tags: "tags",
    ImageMetadata: "image_metadata",
    ImageAnalysis: "image_analysis",
    Metadata: "metadata",
    QualityAnalysis: "quality_analysis",
    AccessibilityAnalysis: "accessibility_analysis",
};
/** @internal */
exports.SearchParametersType$inboundSchema = z.nativeEnum(exports.SearchParametersType);
/** @internal */
exports.SearchParametersType$outboundSchema = exports.SearchParametersType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SearchParametersType$;
(function (SearchParametersType$) {
    /** @deprecated use `SearchParametersType$inboundSchema` instead. */
    SearchParametersType$.inboundSchema = exports.SearchParametersType$inboundSchema;
    /** @deprecated use `SearchParametersType$outboundSchema` instead. */
    SearchParametersType$.outboundSchema = exports.SearchParametersType$outboundSchema;
})(SearchParametersType$ || (exports.SearchParametersType$ = SearchParametersType$ = {}));
/** @internal */
exports.SearchParametersRange$inboundSchema = z.object({
    from: z.number().optional(),
    to: z.number().optional(),
});
/** @internal */
exports.SearchParametersRange$outboundSchema = z.object({
    from: z.number().optional(),
    to: z.number().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SearchParametersRange$;
(function (SearchParametersRange$) {
    /** @deprecated use `SearchParametersRange$inboundSchema` instead. */
    SearchParametersRange$.inboundSchema = exports.SearchParametersRange$inboundSchema;
    /** @deprecated use `SearchParametersRange$outboundSchema` instead. */
    SearchParametersRange$.outboundSchema = exports.SearchParametersRange$outboundSchema;
})(SearchParametersRange$ || (exports.SearchParametersRange$ = SearchParametersRange$ = {}));
function searchParametersRangeToJSON(searchParametersRange) {
    return JSON.stringify(exports.SearchParametersRange$outboundSchema.parse(searchParametersRange));
}
function searchParametersRangeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SearchParametersRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchParametersRange' from JSON`);
}
/** @internal */
exports.Aggregate$inboundSchema = z.object({
    type: exports.SearchParametersType$inboundSchema,
    ranges: z.array(z.lazy(() => exports.SearchParametersRange$inboundSchema)),
});
/** @internal */
exports.Aggregate$outboundSchema = z.object({
    type: exports.SearchParametersType$outboundSchema,
    ranges: z.array(z.lazy(() => exports.SearchParametersRange$outboundSchema)),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Aggregate$;
(function (Aggregate$) {
    /** @deprecated use `Aggregate$inboundSchema` instead. */
    Aggregate$.inboundSchema = exports.Aggregate$inboundSchema;
    /** @deprecated use `Aggregate$outboundSchema` instead. */
    Aggregate$.outboundSchema = exports.Aggregate$outboundSchema;
})(Aggregate$ || (exports.Aggregate$ = Aggregate$ = {}));
function aggregateToJSON(aggregate) {
    return JSON.stringify(exports.Aggregate$outboundSchema.parse(aggregate));
}
function aggregateFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Aggregate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Aggregate' from JSON`);
}
/** @internal */
exports.AggregateEnum$inboundSchema = z.nativeEnum(exports.AggregateEnum);
/** @internal */
exports.AggregateEnum$outboundSchema = exports.AggregateEnum$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AggregateEnum$;
(function (AggregateEnum$) {
    /** @deprecated use `AggregateEnum$inboundSchema` instead. */
    AggregateEnum$.inboundSchema = exports.AggregateEnum$inboundSchema;
    /** @deprecated use `AggregateEnum$outboundSchema` instead. */
    AggregateEnum$.outboundSchema = exports.AggregateEnum$outboundSchema;
})(AggregateEnum$ || (exports.AggregateEnum$ = AggregateEnum$ = {}));
/** @internal */
exports.AggregateUnion$inboundSchema = z.union([
    z.array(exports.AggregateEnum$inboundSchema),
    z.array(z.lazy(() => exports.Aggregate$inboundSchema)),
]);
/** @internal */
exports.AggregateUnion$outboundSchema = z.union([
    z.array(exports.AggregateEnum$outboundSchema),
    z.array(z.lazy(() => exports.Aggregate$outboundSchema)),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AggregateUnion$;
(function (AggregateUnion$) {
    /** @deprecated use `AggregateUnion$inboundSchema` instead. */
    AggregateUnion$.inboundSchema = exports.AggregateUnion$inboundSchema;
    /** @deprecated use `AggregateUnion$outboundSchema` instead. */
    AggregateUnion$.outboundSchema = exports.AggregateUnion$outboundSchema;
})(AggregateUnion$ || (exports.AggregateUnion$ = AggregateUnion$ = {}));
function aggregateUnionToJSON(aggregateUnion) {
    return JSON.stringify(exports.AggregateUnion$outboundSchema.parse(aggregateUnion));
}
function aggregateUnionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AggregateUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AggregateUnion' from JSON`);
}
/** @internal */
exports.WithField$inboundSchema = z
    .nativeEnum(exports.WithField);
/** @internal */
exports.WithField$outboundSchema = exports.WithField$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var WithField$;
(function (WithField$) {
    /** @deprecated use `WithField$inboundSchema` instead. */
    WithField$.inboundSchema = exports.WithField$inboundSchema;
    /** @deprecated use `WithField$outboundSchema` instead. */
    WithField$.outboundSchema = exports.WithField$outboundSchema;
})(WithField$ || (exports.WithField$ = WithField$ = {}));
/** @internal */
exports.SearchParameters$inboundSchema = z.object({
    expression: z.string().optional(),
    sort_by: z.array(z.string()).optional(),
    max_results: z.number().int().optional(),
    next_cursor: z.string().optional(),
    aggregate: z.union([
        z.array(exports.AggregateEnum$inboundSchema),
        z.array(z.lazy(() => exports.Aggregate$inboundSchema)),
    ]).optional(),
    with_field: z.array(exports.WithField$inboundSchema).optional(),
    fields: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "sort_by": "sortBy",
        "max_results": "maxResults",
        "next_cursor": "nextCursor",
        "with_field": "withField",
    });
});
/** @internal */
exports.SearchParameters$outboundSchema = z.object({
    expression: z.string().optional(),
    sortBy: z.array(z.string()).optional(),
    maxResults: z.number().int().optional(),
    nextCursor: z.string().optional(),
    aggregate: z.union([
        z.array(exports.AggregateEnum$outboundSchema),
        z.array(z.lazy(() => exports.Aggregate$outboundSchema)),
    ]).optional(),
    withField: z.array(exports.WithField$outboundSchema).optional(),
    fields: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sortBy: "sort_by",
        maxResults: "max_results",
        nextCursor: "next_cursor",
        withField: "with_field",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SearchParameters$;
(function (SearchParameters$) {
    /** @deprecated use `SearchParameters$inboundSchema` instead. */
    SearchParameters$.inboundSchema = exports.SearchParameters$inboundSchema;
    /** @deprecated use `SearchParameters$outboundSchema` instead. */
    SearchParameters$.outboundSchema = exports.SearchParameters$outboundSchema;
})(SearchParameters$ || (exports.SearchParameters$ = SearchParameters$ = {}));
function searchParametersToJSON(searchParameters) {
    return JSON.stringify(exports.SearchParameters$outboundSchema.parse(searchParameters));
}
function searchParametersFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SearchParameters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchParameters' from JSON`);
}
//# sourceMappingURL=searchparameters.js.map