/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";

export type FilesApiRoutesGetSignedUrlRequest = {
  fileId: string;
  /**
   * Number of hours before the url becomes invalid. Defaults to 24h
   */
  expiry?: number | undefined;
};

/** @internal */
export type FilesApiRoutesGetSignedUrlRequest$Outbound = {
  file_id: string;
  expiry: number;
};

/** @internal */
export const FilesApiRoutesGetSignedUrlRequest$outboundSchema: z.ZodType<
  FilesApiRoutesGetSignedUrlRequest$Outbound,
  z.ZodTypeDef,
  FilesApiRoutesGetSignedUrlRequest
> = z.object({
  fileId: z.string(),
  expiry: z.number().int().default(24),
}).transform((v) => {
  return remap$(v, {
    fileId: "file_id",
  });
});

export function filesApiRoutesGetSignedUrlRequestToJSON(
  filesApiRoutesGetSignedUrlRequest: FilesApiRoutesGetSignedUrlRequest,
): string {
  return JSON.stringify(
    FilesApiRoutesGetSignedUrlRequest$outboundSchema.parse(
      filesApiRoutesGetSignedUrlRequest,
    ),
  );
}
