/*
 * 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";

export type RemoveCertRequest = {
  /**
   * The cert id to remove
   */
  id: 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 RemoveCertResponseBody = {};

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

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

export function removeCertRequestToJSON(
  removeCertRequest: RemoveCertRequest,
): string {
  return JSON.stringify(
    RemoveCertRequest$outboundSchema.parse(removeCertRequest),
  );
}

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

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