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

import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
import { Snapshot, Snapshot$inboundSchema } from "./snapshot.js";

export type DeleteSessionSnapshotRequest = {
  /**
   * The unique identifier of the snapshot to delete.
   */
  snapshotId: string;
  /**
   * The Team identifier to perform the request on behalf of.
   */
  teamId?: string | undefined;
  /**
   * The Team slug to perform the request on behalf of.
   */
  slug?: string | undefined;
};

export type DeleteSessionSnapshotResponseBody = {
  /**
   * This object contains information related to a Snapshot of a Vercel Sandbox session (v2 API).
   */
  snapshot: Snapshot;
};

/** @internal */
export type DeleteSessionSnapshotRequest$Outbound = {
  snapshotId: string;
  teamId?: string | undefined;
  slug?: string | undefined;
};

/** @internal */
export const DeleteSessionSnapshotRequest$outboundSchema: z.ZodType<
  DeleteSessionSnapshotRequest$Outbound,
  z.ZodTypeDef,
  DeleteSessionSnapshotRequest
> = z.object({
  snapshotId: z.string(),
  teamId: z.string().optional(),
  slug: z.string().optional(),
});

export function deleteSessionSnapshotRequestToJSON(
  deleteSessionSnapshotRequest: DeleteSessionSnapshotRequest,
): string {
  return JSON.stringify(
    DeleteSessionSnapshotRequest$outboundSchema.parse(
      deleteSessionSnapshotRequest,
    ),
  );
}

/** @internal */
export const DeleteSessionSnapshotResponseBody$inboundSchema: z.ZodType<
  DeleteSessionSnapshotResponseBody,
  z.ZodTypeDef,
  unknown
> = z.object({
  snapshot: Snapshot$inboundSchema,
});

export function deleteSessionSnapshotResponseBodyFromJSON(
  jsonString: string,
): SafeParseResult<DeleteSessionSnapshotResponseBody, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => DeleteSessionSnapshotResponseBody$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'DeleteSessionSnapshotResponseBody' from JSON`,
  );
}
