/*
 * 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 * as types from "../types/primitives.js";
import { SDKValidationError } from "./sdkvalidationerror.js";

export type DeleteProjectCheckRequest = {
  projectIdOrName: string;
  checkId: 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 DeleteProjectCheckResponseBody = {
  success: true;
};

/** @internal */
export type DeleteProjectCheckRequest$Outbound = {
  projectIdOrName: string;
  checkId: string;
  teamId?: string | undefined;
  slug?: string | undefined;
};

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

export function deleteProjectCheckRequestToJSON(
  deleteProjectCheckRequest: DeleteProjectCheckRequest,
): string {
  return JSON.stringify(
    DeleteProjectCheckRequest$outboundSchema.parse(deleteProjectCheckRequest),
  );
}

/** @internal */
export const DeleteProjectCheckResponseBody$inboundSchema: z.ZodType<
  DeleteProjectCheckResponseBody,
  z.ZodTypeDef,
  unknown
> = z.object({
  success: types.literal(true),
});

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