/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
/**
 * The type of resource.
 */
export const SearchResponseResourceType = {
    Image: "image",
    Video: "video",
    Raw: "raw",
};
/**
 * The delivery type of the asset.
 */
export const SearchResponseType = {
    Upload: "upload",
    Private: "private",
    Authenticated: "authenticated",
    List: "list",
    Fetch: "fetch",
};
/**
 * The current status of the asset.
 */
export const SearchResponseStatus = {
    Active: "active",
    Inactive: "inactive",
};
/**
 * The access mode of the asset.
 */
export const SearchResponseAccessMode = {
    Public: "public",
    Authenticated: "authenticated",
};
/** @internal */
export const SearchResponseResourceType$inboundSchema = z.nativeEnum(SearchResponseResourceType);
/** @internal */
export const SearchResponseResourceType$outboundSchema = SearchResponseResourceType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponseResourceType$;
(function (SearchResponseResourceType$) {
    /** @deprecated use `SearchResponseResourceType$inboundSchema` instead. */
    SearchResponseResourceType$.inboundSchema = SearchResponseResourceType$inboundSchema;
    /** @deprecated use `SearchResponseResourceType$outboundSchema` instead. */
    SearchResponseResourceType$.outboundSchema = SearchResponseResourceType$outboundSchema;
})(SearchResponseResourceType$ || (SearchResponseResourceType$ = {}));
/** @internal */
export const SearchResponseType$inboundSchema = z.nativeEnum(SearchResponseType);
/** @internal */
export const SearchResponseType$outboundSchema = SearchResponseType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponseType$;
(function (SearchResponseType$) {
    /** @deprecated use `SearchResponseType$inboundSchema` instead. */
    SearchResponseType$.inboundSchema = SearchResponseType$inboundSchema;
    /** @deprecated use `SearchResponseType$outboundSchema` instead. */
    SearchResponseType$.outboundSchema = SearchResponseType$outboundSchema;
})(SearchResponseType$ || (SearchResponseType$ = {}));
/** @internal */
export const SearchResponseStatus$inboundSchema = z.nativeEnum(SearchResponseStatus);
/** @internal */
export const SearchResponseStatus$outboundSchema = SearchResponseStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponseStatus$;
(function (SearchResponseStatus$) {
    /** @deprecated use `SearchResponseStatus$inboundSchema` instead. */
    SearchResponseStatus$.inboundSchema = SearchResponseStatus$inboundSchema;
    /** @deprecated use `SearchResponseStatus$outboundSchema` instead. */
    SearchResponseStatus$.outboundSchema = SearchResponseStatus$outboundSchema;
})(SearchResponseStatus$ || (SearchResponseStatus$ = {}));
/** @internal */
export const SearchResponseAccessMode$inboundSchema = z.nativeEnum(SearchResponseAccessMode);
/** @internal */
export const SearchResponseAccessMode$outboundSchema = SearchResponseAccessMode$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponseAccessMode$;
(function (SearchResponseAccessMode$) {
    /** @deprecated use `SearchResponseAccessMode$inboundSchema` instead. */
    SearchResponseAccessMode$.inboundSchema = SearchResponseAccessMode$inboundSchema;
    /** @deprecated use `SearchResponseAccessMode$outboundSchema` instead. */
    SearchResponseAccessMode$.outboundSchema = SearchResponseAccessMode$outboundSchema;
})(SearchResponseAccessMode$ || (SearchResponseAccessMode$ = {}));
/** @internal */
export const SearchResponseAccessControl$inboundSchema = z.object({});
/** @internal */
export const SearchResponseAccessControl$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponseAccessControl$;
(function (SearchResponseAccessControl$) {
    /** @deprecated use `SearchResponseAccessControl$inboundSchema` instead. */
    SearchResponseAccessControl$.inboundSchema = SearchResponseAccessControl$inboundSchema;
    /** @deprecated use `SearchResponseAccessControl$outboundSchema` instead. */
    SearchResponseAccessControl$.outboundSchema = SearchResponseAccessControl$outboundSchema;
})(SearchResponseAccessControl$ || (SearchResponseAccessControl$ = {}));
export function searchResponseAccessControlToJSON(searchResponseAccessControl) {
    return JSON.stringify(SearchResponseAccessControl$outboundSchema.parse(searchResponseAccessControl));
}
export function searchResponseAccessControlFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SearchResponseAccessControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchResponseAccessControl' from JSON`);
}
/** @internal */
export const CreatedBy$inboundSchema = z.object({
    access_key: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "access_key": "accessKey",
    });
});
/** @internal */
export const CreatedBy$outboundSchema = z.object({
    accessKey: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        accessKey: "access_key",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreatedBy$;
(function (CreatedBy$) {
    /** @deprecated use `CreatedBy$inboundSchema` instead. */
    CreatedBy$.inboundSchema = CreatedBy$inboundSchema;
    /** @deprecated use `CreatedBy$outboundSchema` instead. */
    CreatedBy$.outboundSchema = CreatedBy$outboundSchema;
})(CreatedBy$ || (CreatedBy$ = {}));
export function createdByToJSON(createdBy) {
    return JSON.stringify(CreatedBy$outboundSchema.parse(createdBy));
}
export function createdByFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreatedBy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreatedBy' from JSON`);
}
/** @internal */
export const UploadedBy$inboundSchema = z.object({
    access_key: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "access_key": "accessKey",
    });
});
/** @internal */
export const UploadedBy$outboundSchema = z.object({
    accessKey: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        accessKey: "access_key",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var UploadedBy$;
(function (UploadedBy$) {
    /** @deprecated use `UploadedBy$inboundSchema` instead. */
    UploadedBy$.inboundSchema = UploadedBy$inboundSchema;
    /** @deprecated use `UploadedBy$outboundSchema` instead. */
    UploadedBy$.outboundSchema = UploadedBy$outboundSchema;
})(UploadedBy$ || (UploadedBy$ = {}));
export function uploadedByToJSON(uploadedBy) {
    return JSON.stringify(UploadedBy$outboundSchema.parse(uploadedBy));
}
export function uploadedByFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadedBy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadedBy' from JSON`);
}
/** @internal */
export const SearchResponseContext$inboundSchema = z.object({});
/** @internal */
export const SearchResponseContext$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponseContext$;
(function (SearchResponseContext$) {
    /** @deprecated use `SearchResponseContext$inboundSchema` instead. */
    SearchResponseContext$.inboundSchema = SearchResponseContext$inboundSchema;
    /** @deprecated use `SearchResponseContext$outboundSchema` instead. */
    SearchResponseContext$.outboundSchema = SearchResponseContext$outboundSchema;
})(SearchResponseContext$ || (SearchResponseContext$ = {}));
export function searchResponseContextToJSON(searchResponseContext) {
    return JSON.stringify(SearchResponseContext$outboundSchema.parse(searchResponseContext));
}
export function searchResponseContextFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SearchResponseContext$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchResponseContext' from JSON`);
}
/** @internal */
export const SearchResponseImageMetadata$inboundSchema = z.object({});
/** @internal */
export const SearchResponseImageMetadata$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponseImageMetadata$;
(function (SearchResponseImageMetadata$) {
    /** @deprecated use `SearchResponseImageMetadata$inboundSchema` instead. */
    SearchResponseImageMetadata$.inboundSchema = SearchResponseImageMetadata$inboundSchema;
    /** @deprecated use `SearchResponseImageMetadata$outboundSchema` instead. */
    SearchResponseImageMetadata$.outboundSchema = SearchResponseImageMetadata$outboundSchema;
})(SearchResponseImageMetadata$ || (SearchResponseImageMetadata$ = {}));
export function searchResponseImageMetadataToJSON(searchResponseImageMetadata) {
    return JSON.stringify(SearchResponseImageMetadata$outboundSchema.parse(searchResponseImageMetadata));
}
export function searchResponseImageMetadataFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SearchResponseImageMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchResponseImageMetadata' from JSON`);
}
/** @internal */
export const ImageAnalysis$inboundSchema = z.object({});
/** @internal */
export const ImageAnalysis$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ImageAnalysis$;
(function (ImageAnalysis$) {
    /** @deprecated use `ImageAnalysis$inboundSchema` instead. */
    ImageAnalysis$.inboundSchema = ImageAnalysis$inboundSchema;
    /** @deprecated use `ImageAnalysis$outboundSchema` instead. */
    ImageAnalysis$.outboundSchema = ImageAnalysis$outboundSchema;
})(ImageAnalysis$ || (ImageAnalysis$ = {}));
export function imageAnalysisToJSON(imageAnalysis) {
    return JSON.stringify(ImageAnalysis$outboundSchema.parse(imageAnalysis));
}
export function imageAnalysisFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ImageAnalysis$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageAnalysis' from JSON`);
}
/** @internal */
export const Metadata$inboundSchema = z.object({});
/** @internal */
export const Metadata$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Metadata$;
(function (Metadata$) {
    /** @deprecated use `Metadata$inboundSchema` instead. */
    Metadata$.inboundSchema = Metadata$inboundSchema;
    /** @deprecated use `Metadata$outboundSchema` instead. */
    Metadata$.outboundSchema = Metadata$outboundSchema;
})(Metadata$ || (Metadata$ = {}));
export function metadataToJSON(metadata) {
    return JSON.stringify(Metadata$outboundSchema.parse(metadata));
}
export function metadataFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Metadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Metadata' from JSON`);
}
/** @internal */
export const QualityAnalysis$inboundSchema = z.object({});
/** @internal */
export const QualityAnalysis$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var QualityAnalysis$;
(function (QualityAnalysis$) {
    /** @deprecated use `QualityAnalysis$inboundSchema` instead. */
    QualityAnalysis$.inboundSchema = QualityAnalysis$inboundSchema;
    /** @deprecated use `QualityAnalysis$outboundSchema` instead. */
    QualityAnalysis$.outboundSchema = QualityAnalysis$outboundSchema;
})(QualityAnalysis$ || (QualityAnalysis$ = {}));
export function qualityAnalysisToJSON(qualityAnalysis) {
    return JSON.stringify(QualityAnalysis$outboundSchema.parse(qualityAnalysis));
}
export function qualityAnalysisFromJSON(jsonString) {
    return safeParse(jsonString, (x) => QualityAnalysis$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QualityAnalysis' from JSON`);
}
/** @internal */
export const AccessibilityAnalysis$inboundSchema = z.object({});
/** @internal */
export const AccessibilityAnalysis$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AccessibilityAnalysis$;
(function (AccessibilityAnalysis$) {
    /** @deprecated use `AccessibilityAnalysis$inboundSchema` instead. */
    AccessibilityAnalysis$.inboundSchema = AccessibilityAnalysis$inboundSchema;
    /** @deprecated use `AccessibilityAnalysis$outboundSchema` instead. */
    AccessibilityAnalysis$.outboundSchema = AccessibilityAnalysis$outboundSchema;
})(AccessibilityAnalysis$ || (AccessibilityAnalysis$ = {}));
export function accessibilityAnalysisToJSON(accessibilityAnalysis) {
    return JSON.stringify(AccessibilityAnalysis$outboundSchema.parse(accessibilityAnalysis));
}
export function accessibilityAnalysisFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AccessibilityAnalysis$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccessibilityAnalysis' from JSON`);
}
/** @internal */
export const Resource$inboundSchema = z.object({
    asset_id: z.string().optional(),
    public_id: z.string().optional(),
    asset_folder: z.string().optional(),
    filename: z.string().optional(),
    display_name: z.string().optional(),
    format: z.string().optional(),
    version: z.number().int().optional(),
    resource_type: SearchResponseResourceType$inboundSchema.optional(),
    type: SearchResponseType$inboundSchema.optional(),
    created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    uploaded_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    bytes: z.number().int().optional(),
    backup_bytes: z.number().int().optional(),
    width: z.number().int().optional(),
    height: z.number().int().optional(),
    aspect_ratio: z.number().optional(),
    pixels: z.number().int().optional(),
    url: z.string().optional(),
    secure_url: z.string().optional(),
    status: SearchResponseStatus$inboundSchema.optional(),
    access_mode: SearchResponseAccessMode$inboundSchema.optional(),
    access_control: z.nullable(z.lazy(() => SearchResponseAccessControl$inboundSchema)).optional(),
    etag: z.string().optional(),
    created_by: z.lazy(() => CreatedBy$inboundSchema).optional(),
    uploaded_by: z.lazy(() => UploadedBy$inboundSchema).optional(),
    context: z.lazy(() => SearchResponseContext$inboundSchema).optional(),
    tags: z.array(z.string()).optional(),
    image_metadata: z.lazy(() => SearchResponseImageMetadata$inboundSchema)
        .optional(),
    image_analysis: z.lazy(() => ImageAnalysis$inboundSchema).optional(),
    metadata: z.lazy(() => Metadata$inboundSchema).optional(),
    quality_analysis: z.lazy(() => QualityAnalysis$inboundSchema).optional(),
    accessibility_analysis: z.lazy(() => AccessibilityAnalysis$inboundSchema)
        .optional(),
}).transform((v) => {
    return remap$(v, {
        "asset_id": "assetId",
        "public_id": "publicId",
        "asset_folder": "assetFolder",
        "display_name": "displayName",
        "resource_type": "resourceType",
        "created_at": "createdAt",
        "uploaded_at": "uploadedAt",
        "backup_bytes": "backupBytes",
        "aspect_ratio": "aspectRatio",
        "secure_url": "secureUrl",
        "access_mode": "accessMode",
        "access_control": "accessControl",
        "created_by": "createdBy",
        "uploaded_by": "uploadedBy",
        "image_metadata": "imageMetadata",
        "image_analysis": "imageAnalysis",
        "quality_analysis": "qualityAnalysis",
        "accessibility_analysis": "accessibilityAnalysis",
    });
});
/** @internal */
export const Resource$outboundSchema = z.object({
    assetId: z.string().optional(),
    publicId: z.string().optional(),
    assetFolder: z.string().optional(),
    filename: z.string().optional(),
    displayName: z.string().optional(),
    format: z.string().optional(),
    version: z.number().int().optional(),
    resourceType: SearchResponseResourceType$outboundSchema.optional(),
    type: SearchResponseType$outboundSchema.optional(),
    createdAt: z.date().transform(v => v.toISOString()).optional(),
    uploadedAt: z.date().transform(v => v.toISOString()).optional(),
    bytes: z.number().int().optional(),
    backupBytes: z.number().int().optional(),
    width: z.number().int().optional(),
    height: z.number().int().optional(),
    aspectRatio: z.number().optional(),
    pixels: z.number().int().optional(),
    url: z.string().optional(),
    secureUrl: z.string().optional(),
    status: SearchResponseStatus$outboundSchema.optional(),
    accessMode: SearchResponseAccessMode$outboundSchema.optional(),
    accessControl: z.nullable(z.lazy(() => SearchResponseAccessControl$outboundSchema)).optional(),
    etag: z.string().optional(),
    createdBy: z.lazy(() => CreatedBy$outboundSchema).optional(),
    uploadedBy: z.lazy(() => UploadedBy$outboundSchema).optional(),
    context: z.lazy(() => SearchResponseContext$outboundSchema).optional(),
    tags: z.array(z.string()).optional(),
    imageMetadata: z.lazy(() => SearchResponseImageMetadata$outboundSchema)
        .optional(),
    imageAnalysis: z.lazy(() => ImageAnalysis$outboundSchema).optional(),
    metadata: z.lazy(() => Metadata$outboundSchema).optional(),
    qualityAnalysis: z.lazy(() => QualityAnalysis$outboundSchema).optional(),
    accessibilityAnalysis: z.lazy(() => AccessibilityAnalysis$outboundSchema)
        .optional(),
}).transform((v) => {
    return remap$(v, {
        assetId: "asset_id",
        publicId: "public_id",
        assetFolder: "asset_folder",
        displayName: "display_name",
        resourceType: "resource_type",
        createdAt: "created_at",
        uploadedAt: "uploaded_at",
        backupBytes: "backup_bytes",
        aspectRatio: "aspect_ratio",
        secureUrl: "secure_url",
        accessMode: "access_mode",
        accessControl: "access_control",
        createdBy: "created_by",
        uploadedBy: "uploaded_by",
        imageMetadata: "image_metadata",
        imageAnalysis: "image_analysis",
        qualityAnalysis: "quality_analysis",
        accessibilityAnalysis: "accessibility_analysis",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Resource$;
(function (Resource$) {
    /** @deprecated use `Resource$inboundSchema` instead. */
    Resource$.inboundSchema = Resource$inboundSchema;
    /** @deprecated use `Resource$outboundSchema` instead. */
    Resource$.outboundSchema = Resource$outboundSchema;
})(Resource$ || (Resource$ = {}));
export function resourceToJSON(resource) {
    return JSON.stringify(Resource$outboundSchema.parse(resource));
}
export function resourceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Resource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Resource' from JSON`);
}
/** @internal */
export const Value$inboundSchema = z
    .object({
    value: z.string().optional(),
    count: z.number().int().optional(),
});
/** @internal */
export const Value$outboundSchema = z.object({
    value: z.string().optional(),
    count: z.number().int().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Value$;
(function (Value$) {
    /** @deprecated use `Value$inboundSchema` instead. */
    Value$.inboundSchema = Value$inboundSchema;
    /** @deprecated use `Value$outboundSchema` instead. */
    Value$.outboundSchema = Value$outboundSchema;
})(Value$ || (Value$ = {}));
export function valueToJSON(value) {
    return JSON.stringify(Value$outboundSchema.parse(value));
}
export function valueFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Value$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Value' from JSON`);
}
/** @internal */
export const SearchResponseRange$inboundSchema = z.object({
    from: z.number().optional(),
    to: z.number().optional(),
    count: z.number().int().optional(),
});
/** @internal */
export const SearchResponseRange$outboundSchema = z.object({
    from: z.number().optional(),
    to: z.number().optional(),
    count: z.number().int().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponseRange$;
(function (SearchResponseRange$) {
    /** @deprecated use `SearchResponseRange$inboundSchema` instead. */
    SearchResponseRange$.inboundSchema = SearchResponseRange$inboundSchema;
    /** @deprecated use `SearchResponseRange$outboundSchema` instead. */
    SearchResponseRange$.outboundSchema = SearchResponseRange$outboundSchema;
})(SearchResponseRange$ || (SearchResponseRange$ = {}));
export function searchResponseRangeToJSON(searchResponseRange) {
    return JSON.stringify(SearchResponseRange$outboundSchema.parse(searchResponseRange));
}
export function searchResponseRangeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SearchResponseRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchResponseRange' from JSON`);
}
/** @internal */
export const Aggregations$inboundSchema = z.object({
    values: z.array(z.lazy(() => Value$inboundSchema)).optional(),
    ranges: z.array(z.lazy(() => SearchResponseRange$inboundSchema)).optional(),
});
/** @internal */
export const Aggregations$outboundSchema = z.object({
    values: z.array(z.lazy(() => Value$outboundSchema)).optional(),
    ranges: z.array(z.lazy(() => SearchResponseRange$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 Aggregations$;
(function (Aggregations$) {
    /** @deprecated use `Aggregations$inboundSchema` instead. */
    Aggregations$.inboundSchema = Aggregations$inboundSchema;
    /** @deprecated use `Aggregations$outboundSchema` instead. */
    Aggregations$.outboundSchema = Aggregations$outboundSchema;
})(Aggregations$ || (Aggregations$ = {}));
export function aggregationsToJSON(aggregations) {
    return JSON.stringify(Aggregations$outboundSchema.parse(aggregations));
}
export function aggregationsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Aggregations$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Aggregations' from JSON`);
}
/** @internal */
export const SearchResponse$inboundSchema = z.object({
    total_count: z.number().int().optional(),
    time: z.number().int().optional(),
    resources: z.array(z.lazy(() => Resource$inboundSchema)).optional(),
    next_cursor: z.nullable(z.string()).optional(),
    aggregations: z.lazy(() => Aggregations$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "total_count": "totalCount",
        "next_cursor": "nextCursor",
    });
});
/** @internal */
export const SearchResponse$outboundSchema = z.object({
    totalCount: z.number().int().optional(),
    time: z.number().int().optional(),
    resources: z.array(z.lazy(() => Resource$outboundSchema)).optional(),
    nextCursor: z.nullable(z.string()).optional(),
    aggregations: z.lazy(() => Aggregations$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        totalCount: "total_count",
        nextCursor: "next_cursor",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SearchResponse$;
(function (SearchResponse$) {
    /** @deprecated use `SearchResponse$inboundSchema` instead. */
    SearchResponse$.inboundSchema = SearchResponse$inboundSchema;
    /** @deprecated use `SearchResponse$outboundSchema` instead. */
    SearchResponse$.outboundSchema = SearchResponse$outboundSchema;
})(SearchResponse$ || (SearchResponse$ = {}));
export function searchResponseToJSON(searchResponse) {
    return JSON.stringify(SearchResponse$outboundSchema.parse(searchResponse));
}
export function searchResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SearchResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchResponse' from JSON`);
}
//# sourceMappingURL=searchresponse.js.map