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

export type BenefitLicenseKeyActivationProperties = {
  limit: number;
  enableCustomerAdmin: boolean;
};

/** @internal */
export const BenefitLicenseKeyActivationProperties$inboundSchema: z.ZodMiniType<
  BenefitLicenseKeyActivationProperties,
  unknown
> = z.pipe(
  z.object({
    limit: z.int(),
    enable_customer_admin: z.boolean(),
  }),
  z.transform((v) => {
    return remap$(v, {
      "enable_customer_admin": "enableCustomerAdmin",
    });
  }),
);
/** @internal */
export type BenefitLicenseKeyActivationProperties$Outbound = {
  limit: number;
  enable_customer_admin: boolean;
};

/** @internal */
export const BenefitLicenseKeyActivationProperties$outboundSchema:
  z.ZodMiniType<
    BenefitLicenseKeyActivationProperties$Outbound,
    BenefitLicenseKeyActivationProperties
  > = z.pipe(
    z.object({
      limit: z.int(),
      enableCustomerAdmin: z.boolean(),
    }),
    z.transform((v) => {
      return remap$(v, {
        enableCustomerAdmin: "enable_customer_admin",
      });
    }),
  );

export function benefitLicenseKeyActivationPropertiesToJSON(
  benefitLicenseKeyActivationProperties: BenefitLicenseKeyActivationProperties,
): string {
  return JSON.stringify(
    BenefitLicenseKeyActivationProperties$outboundSchema.parse(
      benefitLicenseKeyActivationProperties,
    ),
  );
}
export function benefitLicenseKeyActivationPropertiesFromJSON(
  jsonString: string,
): SafeParseResult<BenefitLicenseKeyActivationProperties, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      BenefitLicenseKeyActivationProperties$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'BenefitLicenseKeyActivationProperties' from JSON`,
  );
}
