/*
 * 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 BulkDeleteLinksRequest = {
  /**
   * Comma-separated list of link IDs to delete. Maximum of 100 IDs. Non-existing IDs will be ignored.
   */
  linkIds: Array<string>;
};

/**
 * The deleted links count.
 */
export type BulkDeleteLinksResponseBody = {
  /**
   * The number of links deleted.
   */
  deletedCount: number;
};

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

/** @internal */
export type BulkDeleteLinksRequest$Outbound = {
  linkIds: Array<string>;
};

/** @internal */
export const BulkDeleteLinksRequest$outboundSchema: z.ZodType<
  BulkDeleteLinksRequest$Outbound,
  z.ZodTypeDef,
  BulkDeleteLinksRequest
> = z.object({
  linkIds: z.array(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 BulkDeleteLinksRequest$ {
  /** @deprecated use `BulkDeleteLinksRequest$inboundSchema` instead. */
  export const inboundSchema = BulkDeleteLinksRequest$inboundSchema;
  /** @deprecated use `BulkDeleteLinksRequest$outboundSchema` instead. */
  export const outboundSchema = BulkDeleteLinksRequest$outboundSchema;
  /** @deprecated use `BulkDeleteLinksRequest$Outbound` instead. */
  export type Outbound = BulkDeleteLinksRequest$Outbound;
}

export function bulkDeleteLinksRequestToJSON(
  bulkDeleteLinksRequest: BulkDeleteLinksRequest,
): string {
  return JSON.stringify(
    BulkDeleteLinksRequest$outboundSchema.parse(bulkDeleteLinksRequest),
  );
}

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

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

/** @internal */
export type BulkDeleteLinksResponseBody$Outbound = {
  deletedCount: number;
};

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

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

export function bulkDeleteLinksResponseBodyToJSON(
  bulkDeleteLinksResponseBody: BulkDeleteLinksResponseBody,
): string {
  return JSON.stringify(
    BulkDeleteLinksResponseBody$outboundSchema.parse(
      bulkDeleteLinksResponseBody,
    ),
  );
}

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