"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.GetVideoViewsResponse$ = exports.GetVideoViewsResponse$outboundSchema = exports.GetVideoViewsResponse$inboundSchema = exports.Data$ = exports.Data$outboundSchema = exports.Data$inboundSchema = exports.GetVideoViewsRequest$ = exports.GetVideoViewsRequest$outboundSchema = exports.GetVideoViewsRequest$inboundSchema = exports.SortBy$ = exports.SortBy$outboundSchema = exports.SortBy$inboundSchema = exports.GetVideoViewsGlobals$ = exports.GetVideoViewsGlobals$outboundSchema = exports.GetVideoViewsGlobals$inboundSchema = exports.SortBy = void 0;
exports.getVideoViewsGlobalsToJSON = getVideoViewsGlobalsToJSON;
exports.getVideoViewsGlobalsFromJSON = getVideoViewsGlobalsFromJSON;
exports.getVideoViewsRequestToJSON = getVideoViewsRequestToJSON;
exports.getVideoViewsRequestFromJSON = getVideoViewsRequestFromJSON;
exports.dataToJSON = dataToJSON;
exports.dataFromJSON = dataFromJSON;
exports.getVideoViewsResponseToJSON = getVideoViewsResponseToJSON;
exports.getVideoViewsResponseFromJSON = getVideoViewsResponseFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * Specifies the expression field by which to sort the results. Prepend values with a '-' to reverse the order.
 */
exports.SortBy = {
    ViewEndedAt: "view_ended_at",
    VideoDuration: "video_duration",
    ViewWatchTime: "view_watch_time",
    MinusViewEndedAt: "-view_ended_at",
    MinusVideoDuration: "-video_duration",
    MinusViewWatchTime: "-view_watch_time",
};
/** @internal */
exports.GetVideoViewsGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
exports.GetVideoViewsGlobals$outboundSchema = z.object({
    cloudName: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        cloudName: "cloud_name",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var GetVideoViewsGlobals$;
(function (GetVideoViewsGlobals$) {
    /** @deprecated use `GetVideoViewsGlobals$inboundSchema` instead. */
    GetVideoViewsGlobals$.inboundSchema = exports.GetVideoViewsGlobals$inboundSchema;
    /** @deprecated use `GetVideoViewsGlobals$outboundSchema` instead. */
    GetVideoViewsGlobals$.outboundSchema = exports.GetVideoViewsGlobals$outboundSchema;
})(GetVideoViewsGlobals$ || (exports.GetVideoViewsGlobals$ = GetVideoViewsGlobals$ = {}));
function getVideoViewsGlobalsToJSON(getVideoViewsGlobals) {
    return JSON.stringify(exports.GetVideoViewsGlobals$outboundSchema.parse(getVideoViewsGlobals));
}
function getVideoViewsGlobalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetVideoViewsGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetVideoViewsGlobals' from JSON`);
}
/** @internal */
exports.SortBy$inboundSchema = z
    .nativeEnum(exports.SortBy);
/** @internal */
exports.SortBy$outboundSchema = exports.SortBy$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SortBy$;
(function (SortBy$) {
    /** @deprecated use `SortBy$inboundSchema` instead. */
    SortBy$.inboundSchema = exports.SortBy$inboundSchema;
    /** @deprecated use `SortBy$outboundSchema` instead. */
    SortBy$.outboundSchema = exports.SortBy$outboundSchema;
})(SortBy$ || (exports.SortBy$ = SortBy$ = {}));
/** @internal */
exports.GetVideoViewsRequest$inboundSchema = z.object({
    expression: z.string().optional(),
    max_results: z.number().int().default(10),
    sort_by: exports.SortBy$inboundSchema.default("-view_ended_at"),
    next_cursor: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "max_results": "maxResults",
        "sort_by": "sortBy",
        "next_cursor": "nextCursor",
    });
});
/** @internal */
exports.GetVideoViewsRequest$outboundSchema = z.object({
    expression: z.string().optional(),
    maxResults: z.number().int().default(10),
    sortBy: exports.SortBy$outboundSchema.default("-view_ended_at"),
    nextCursor: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        maxResults: "max_results",
        sortBy: "sort_by",
        nextCursor: "next_cursor",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var GetVideoViewsRequest$;
(function (GetVideoViewsRequest$) {
    /** @deprecated use `GetVideoViewsRequest$inboundSchema` instead. */
    GetVideoViewsRequest$.inboundSchema = exports.GetVideoViewsRequest$inboundSchema;
    /** @deprecated use `GetVideoViewsRequest$outboundSchema` instead. */
    GetVideoViewsRequest$.outboundSchema = exports.GetVideoViewsRequest$outboundSchema;
})(GetVideoViewsRequest$ || (exports.GetVideoViewsRequest$ = GetVideoViewsRequest$ = {}));
function getVideoViewsRequestToJSON(getVideoViewsRequest) {
    return JSON.stringify(exports.GetVideoViewsRequest$outboundSchema.parse(getVideoViewsRequest));
}
function getVideoViewsRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetVideoViewsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetVideoViewsRequest' from JSON`);
}
/** @internal */
exports.Data$inboundSchema = z
    .object({
    video_public_id: z.string().optional(),
    video_duration: z.nullable(z.number()).optional(),
    video_transformation: z.nullable(z.string()).optional(),
    video_extension: z.nullable(z.string()).optional(),
    viewer_application_name: z.nullable(z.string()).optional(),
    viewer_location_country_code: z.nullable(z.string()).optional(),
    viewer_os_identifier: z.nullable(z.string()).optional(),
    view_watch_time: z.nullable(z.number()).optional(),
    view_ended_at: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "video_public_id": "videoPublicId",
        "video_duration": "videoDuration",
        "video_transformation": "videoTransformation",
        "video_extension": "videoExtension",
        "viewer_application_name": "viewerApplicationName",
        "viewer_location_country_code": "viewerLocationCountryCode",
        "viewer_os_identifier": "viewerOsIdentifier",
        "view_watch_time": "viewWatchTime",
        "view_ended_at": "viewEndedAt",
    });
});
/** @internal */
exports.Data$outboundSchema = z.object({
    videoPublicId: z.string().optional(),
    videoDuration: z.nullable(z.number()).optional(),
    videoTransformation: z.nullable(z.string()).optional(),
    videoExtension: z.nullable(z.string()).optional(),
    viewerApplicationName: z.nullable(z.string()).optional(),
    viewerLocationCountryCode: z.nullable(z.string()).optional(),
    viewerOsIdentifier: z.nullable(z.string()).optional(),
    viewWatchTime: z.nullable(z.number()).optional(),
    viewEndedAt: z.date().transform(v => v.toISOString()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        videoPublicId: "video_public_id",
        videoDuration: "video_duration",
        videoTransformation: "video_transformation",
        videoExtension: "video_extension",
        viewerApplicationName: "viewer_application_name",
        viewerLocationCountryCode: "viewer_location_country_code",
        viewerOsIdentifier: "viewer_os_identifier",
        viewWatchTime: "view_watch_time",
        viewEndedAt: "view_ended_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Data$;
(function (Data$) {
    /** @deprecated use `Data$inboundSchema` instead. */
    Data$.inboundSchema = exports.Data$inboundSchema;
    /** @deprecated use `Data$outboundSchema` instead. */
    Data$.outboundSchema = exports.Data$outboundSchema;
})(Data$ || (exports.Data$ = Data$ = {}));
function dataToJSON(data) {
    return JSON.stringify(exports.Data$outboundSchema.parse(data));
}
function dataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Data$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Data' from JSON`);
}
/** @internal */
exports.GetVideoViewsResponse$inboundSchema = z.object({
    request_id: z.string().optional(),
    next_cursor: z.string().optional(),
    data: z.array(z.lazy(() => exports.Data$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "request_id": "requestId",
        "next_cursor": "nextCursor",
    });
});
/** @internal */
exports.GetVideoViewsResponse$outboundSchema = z.object({
    requestId: z.string().optional(),
    nextCursor: z.string().optional(),
    data: z.array(z.lazy(() => exports.Data$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requestId: "request_id",
        nextCursor: "next_cursor",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var GetVideoViewsResponse$;
(function (GetVideoViewsResponse$) {
    /** @deprecated use `GetVideoViewsResponse$inboundSchema` instead. */
    GetVideoViewsResponse$.inboundSchema = exports.GetVideoViewsResponse$inboundSchema;
    /** @deprecated use `GetVideoViewsResponse$outboundSchema` instead. */
    GetVideoViewsResponse$.outboundSchema = exports.GetVideoViewsResponse$outboundSchema;
})(GetVideoViewsResponse$ || (exports.GetVideoViewsResponse$ = GetVideoViewsResponse$ = {}));
function getVideoViewsResponseToJSON(getVideoViewsResponse) {
    return JSON.stringify(exports.GetVideoViewsResponse$outboundSchema.parse(getVideoViewsResponse));
}
function getVideoViewsResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetVideoViewsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetVideoViewsResponse' from JSON`);
}
//# sourceMappingURL=getvideoviews.js.map