/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; /** * The details used to activate a physical gift card. */ export type GiftCardActivationCreate = { /** * The 16-19 digit number for the gift card. */ number: string; /** * The PIN for this gift card. */ pin?: string | null | undefined; /** * The amount to load onto the gift card, in the smallest denomination for the currency. Required if `currency` is provided. */ amount?: number | null | undefined; /** * The ISO-4217 currency code for the `amount`. Required if `amount` is provided. */ currency?: string | null | undefined; /** * An optional external identifier for this activation. */ externalIdentifier?: string | null | undefined; /** * Whether to store the activated gift card in the vault. When `true`, a `pin` is required. */ store?: boolean | undefined; /** * The ID of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this field is provided then the `buyer_external_identifier` field needs to be unset. */ buyerId?: string | null | undefined; /** * The `external_identifier` of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this field is provided then the `buyer_id` field needs to be unset. */ buyerExternalIdentifier?: string | null | undefined; }; /** @internal */ export type GiftCardActivationCreate$Outbound = { number: string; pin?: string | null | undefined; amount?: number | null | undefined; currency?: string | null | undefined; external_identifier?: string | null | undefined; store: boolean; buyer_id?: string | null | undefined; buyer_external_identifier?: string | null | undefined; }; /** @internal */ export const GiftCardActivationCreate$outboundSchema: z.ZodType< GiftCardActivationCreate$Outbound, z.ZodTypeDef, GiftCardActivationCreate > = z.object({ number: z.string(), pin: z.nullable(z.string()).optional(), amount: z.nullable(z.number().int()).optional(), currency: z.nullable(z.string()).optional(), externalIdentifier: z.nullable(z.string()).optional(), store: z.boolean().default(false), buyerId: z.nullable(z.string()).optional(), buyerExternalIdentifier: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { externalIdentifier: "external_identifier", buyerId: "buyer_id", buyerExternalIdentifier: "buyer_external_identifier", }); }); export function giftCardActivationCreateToJSON( giftCardActivationCreate: GiftCardActivationCreate, ): string { return JSON.stringify( GiftCardActivationCreate$outboundSchema.parse(giftCardActivationCreate), ); }