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

import * as z from "zod/v4-mini";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

/**
 * Read-only information about a seat claim invitation.
 *
 * @remarks
 * Safe for email scanners - no side effects when fetched.
 */
export type SeatClaimInfo = {
  /**
   * Name of the product
   */
  productName: string;
  /**
   * ID of the product
   */
  productId: string;
  /**
   * Name of the organization
   */
  organizationName: string;
  /**
   * Slug of the organization
   */
  organizationSlug: string;
  /**
   * Email of the customer assigned to this seat
   */
  customerEmail: string;
  /**
   * Whether the seat can be claimed
   */
  canClaim: boolean;
};

/** @internal */
export const SeatClaimInfo$inboundSchema: z.ZodMiniType<
  SeatClaimInfo,
  unknown
> = z.pipe(
  z.object({
    product_name: z.string(),
    product_id: z.string(),
    organization_name: z.string(),
    organization_slug: z.string(),
    customer_email: z.string(),
    can_claim: z.boolean(),
  }),
  z.transform((v) => {
    return remap$(v, {
      "product_name": "productName",
      "product_id": "productId",
      "organization_name": "organizationName",
      "organization_slug": "organizationSlug",
      "customer_email": "customerEmail",
      "can_claim": "canClaim",
    });
  }),
);

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