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

import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type DeleteTagRequest = {
  /**
   * The ID of the tag to delete.
   */
  id: string;
};

/**
 * The deleted tag ID.
 */
export type DeleteTagResponseBody = {
  /**
   * The ID of the deleted tag.
   */
  id: string;
};

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

/** @internal */
export type DeleteTagRequest$Outbound = {
  id: string;
};

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

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace DeleteTagRequest$ {
  /** @deprecated use `DeleteTagRequest$inboundSchema` instead. */
  export const inboundSchema = DeleteTagRequest$inboundSchema;
  /** @deprecated use `DeleteTagRequest$outboundSchema` instead. */
  export const outboundSchema = DeleteTagRequest$outboundSchema;
  /** @deprecated use `DeleteTagRequest$Outbound` instead. */
  export type Outbound = DeleteTagRequest$Outbound;
}

export function deleteTagRequestToJSON(
  deleteTagRequest: DeleteTagRequest,
): string {
  return JSON.stringify(
    DeleteTagRequest$outboundSchema.parse(deleteTagRequest),
  );
}

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

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

/** @internal */
export type DeleteTagResponseBody$Outbound = {
  id: string;
};

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

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace DeleteTagResponseBody$ {
  /** @deprecated use `DeleteTagResponseBody$inboundSchema` instead. */
  export const inboundSchema = DeleteTagResponseBody$inboundSchema;
  /** @deprecated use `DeleteTagResponseBody$outboundSchema` instead. */
  export const outboundSchema = DeleteTagResponseBody$outboundSchema;
  /** @deprecated use `DeleteTagResponseBody$Outbound` instead. */
  export type Outbound = DeleteTagResponseBody$Outbound;
}

export function deleteTagResponseBodyToJSON(
  deleteTagResponseBody: DeleteTagResponseBody,
): string {
  return JSON.stringify(
    DeleteTagResponseBody$outboundSchema.parse(deleteTagResponseBody),
  );
}

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