/* * 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 { ClosedEnum } from "../../types/enums.js"; import { OrganizationCustomerEmailSettings, OrganizationCustomerEmailSettings$Outbound, OrganizationCustomerEmailSettings$outboundSchema, } from "./organizationcustomeremailsettings.js"; import { OrganizationCustomerPortalSettings, OrganizationCustomerPortalSettings$Outbound, OrganizationCustomerPortalSettings$outboundSchema, } from "./organizationcustomerportalsettings.js"; import { OrganizationDetails, OrganizationDetails$Outbound, OrganizationDetails$outboundSchema, } from "./organizationdetails.js"; import { OrganizationFeatureSettings, OrganizationFeatureSettings$Outbound, OrganizationFeatureSettings$outboundSchema, } from "./organizationfeaturesettings.js"; import { OrganizationNotificationSettings, OrganizationNotificationSettings$Outbound, OrganizationNotificationSettings$outboundSchema, } from "./organizationnotificationsettings.js"; import { OrganizationSocialLink, OrganizationSocialLink$Outbound, OrganizationSocialLink$outboundSchema, } from "./organizationsociallink.js"; import { OrganizationSubscriptionSettings, OrganizationSubscriptionSettings$Outbound, OrganizationSubscriptionSettings$outboundSchema, } from "./organizationsubscriptionsettings.js"; import { PresentmentCurrency, PresentmentCurrency$outboundSchema, } from "./presentmentcurrency.js"; import { TaxBehaviorOption, TaxBehaviorOption$outboundSchema, } from "./taxbehavioroption.js"; export const CountryCountryAlpha2Input = { Ad: "AD", Ae: "AE", Af: "AF", Ag: "AG", Ai: "AI", Al: "AL", Am: "AM", Ao: "AO", Aq: "AQ", Ar: "AR", As: "AS", At: "AT", Au: "AU", Aw: "AW", Ax: "AX", Az: "AZ", Ba: "BA", Bb: "BB", Bd: "BD", Be: "BE", Bf: "BF", Bg: "BG", Bh: "BH", Bi: "BI", Bj: "BJ", Bl: "BL", Bm: "BM", Bn: "BN", Bo: "BO", Bq: "BQ", Br: "BR", Bs: "BS", Bt: "BT", Bv: "BV", Bw: "BW", By: "BY", Bz: "BZ", Ca: "CA", Cc: "CC", Cd: "CD", Cf: "CF", Cg: "CG", Ch: "CH", Ci: "CI", Ck: "CK", Cl: "CL", Cm: "CM", Cn: "CN", Co: "CO", Cr: "CR", Cv: "CV", Cw: "CW", Cx: "CX", Cy: "CY", Cz: "CZ", De: "DE", Dj: "DJ", Dk: "DK", Dm: "DM", Do: "DO", Dz: "DZ", Ec: "EC", Ee: "EE", Eg: "EG", Eh: "EH", Er: "ER", Es: "ES", Et: "ET", Fi: "FI", Fj: "FJ", Fk: "FK", Fm: "FM", Fo: "FO", Fr: "FR", Ga: "GA", Gb: "GB", Gd: "GD", Ge: "GE", Gf: "GF", Gg: "GG", Gh: "GH", Gi: "GI", Gl: "GL", Gm: "GM", Gn: "GN", Gp: "GP", Gq: "GQ", Gr: "GR", Gs: "GS", Gt: "GT", Gu: "GU", Gw: "GW", Gy: "GY", Hk: "HK", Hm: "HM", Hn: "HN", Hr: "HR", Ht: "HT", Hu: "HU", Id: "ID", Ie: "IE", Il: "IL", Im: "IM", In: "IN", Io: "IO", Iq: "IQ", Is: "IS", It: "IT", Je: "JE", Jm: "JM", Jo: "JO", Jp: "JP", Ke: "KE", Kg: "KG", Kh: "KH", Ki: "KI", Km: "KM", Kn: "KN", Kr: "KR", Kw: "KW", Ky: "KY", Kz: "KZ", La: "LA", Lb: "LB", Lc: "LC", Li: "LI", Lk: "LK", Lr: "LR", Ls: "LS", Lt: "LT", Lu: "LU", Lv: "LV", Ly: "LY", Ma: "MA", Mc: "MC", Md: "MD", Me: "ME", Mf: "MF", Mg: "MG", Mh: "MH", Mk: "MK", Ml: "ML", Mm: "MM", Mn: "MN", Mo: "MO", Mp: "MP", Mq: "MQ", Mr: "MR", Ms: "MS", Mt: "MT", Mu: "MU", Mv: "MV", Mw: "MW", Mx: "MX", My: "MY", Mz: "MZ", Na: "NA", Nc: "NC", Ne: "NE", Nf: "NF", Ng: "NG", Ni: "NI", Nl: "NL", No: "NO", Np: "NP", Nr: "NR", Nu: "NU", Nz: "NZ", Om: "OM", Pa: "PA", Pe: "PE", Pf: "PF", Pg: "PG", Ph: "PH", Pk: "PK", Pl: "PL", Pm: "PM", Pn: "PN", Pr: "PR", Ps: "PS", Pt: "PT", Pw: "PW", Py: "PY", Qa: "QA", Re: "RE", Ro: "RO", Rs: "RS", Rw: "RW", Sa: "SA", Sb: "SB", Sc: "SC", Sd: "SD", Se: "SE", Sg: "SG", Sh: "SH", Si: "SI", Sj: "SJ", Sk: "SK", Sl: "SL", Sm: "SM", Sn: "SN", So: "SO", Sr: "SR", Ss: "SS", St: "ST", Sv: "SV", Sx: "SX", Sz: "SZ", Tc: "TC", Td: "TD", Tf: "TF", Tg: "TG", Th: "TH", Tj: "TJ", Tk: "TK", Tl: "TL", Tm: "TM", Tn: "TN", To: "TO", Tr: "TR", Tt: "TT", Tv: "TV", Tw: "TW", Tz: "TZ", Ua: "UA", Ug: "UG", Um: "UM", Us: "US", Uy: "UY", Uz: "UZ", Va: "VA", Vc: "VC", Ve: "VE", Vg: "VG", Vi: "VI", Vn: "VN", Vu: "VU", Wf: "WF", Ws: "WS", Ye: "YE", Yt: "YT", Za: "ZA", Zm: "ZM", Zw: "ZW", } as const; export type CountryCountryAlpha2Input = ClosedEnum< typeof CountryCountryAlpha2Input >; export type OrganizationUpdate = { name?: string | null | undefined; avatarUrl?: string | null | undefined; /** * Public support email. */ email?: string | null | undefined; /** * Official website of the organization. */ website?: string | null | undefined; /** * Links to social profiles. */ socials?: Array | null | undefined; /** * Additional, private, business details Polar needs about active organizations for compliance (KYC). */ details?: OrganizationDetails | null | undefined; /** * Two-letter country code (ISO 3166-1 alpha-2). */ country?: CountryCountryAlpha2Input | null | undefined; featureSettings?: OrganizationFeatureSettings | null | undefined; subscriptionSettings?: OrganizationSubscriptionSettings | null | undefined; notificationSettings?: OrganizationNotificationSettings | null | undefined; customerEmailSettings?: OrganizationCustomerEmailSettings | null | undefined; customerPortalSettings?: | OrganizationCustomerPortalSettings | null | undefined; /** * Default presentment currency for the organization */ defaultPresentmentCurrency?: PresentmentCurrency | null | undefined; /** * Default tax behavior applied on products. */ defaultTaxBehavior?: TaxBehaviorOption | null | undefined; }; /** @internal */ export const CountryCountryAlpha2Input$outboundSchema: z.ZodMiniEnum< typeof CountryCountryAlpha2Input > = z.enum(CountryCountryAlpha2Input); /** @internal */ export type OrganizationUpdate$Outbound = { name?: string | null | undefined; avatar_url?: string | null | undefined; email?: string | null | undefined; website?: string | null | undefined; socials?: Array | null | undefined; details?: OrganizationDetails$Outbound | null | undefined; country?: string | null | undefined; feature_settings?: OrganizationFeatureSettings$Outbound | null | undefined; subscription_settings?: | OrganizationSubscriptionSettings$Outbound | null | undefined; notification_settings?: | OrganizationNotificationSettings$Outbound | null | undefined; customer_email_settings?: | OrganizationCustomerEmailSettings$Outbound | null | undefined; customer_portal_settings?: | OrganizationCustomerPortalSettings$Outbound | null | undefined; default_presentment_currency?: string | null | undefined; default_tax_behavior?: string | null | undefined; }; /** @internal */ export const OrganizationUpdate$outboundSchema: z.ZodMiniType< OrganizationUpdate$Outbound, OrganizationUpdate > = z.pipe( z.object({ name: z.optional(z.nullable(z.string())), avatarUrl: z.optional(z.nullable(z.string())), email: z.optional(z.nullable(z.string())), website: z.optional(z.nullable(z.string())), socials: z.optional( z.nullable(z.array(OrganizationSocialLink$outboundSchema)), ), details: z.optional(z.nullable(OrganizationDetails$outboundSchema)), country: z.optional(z.nullable(CountryCountryAlpha2Input$outboundSchema)), featureSettings: z.optional( z.nullable(OrganizationFeatureSettings$outboundSchema), ), subscriptionSettings: z.optional( z.nullable(OrganizationSubscriptionSettings$outboundSchema), ), notificationSettings: z.optional( z.nullable(OrganizationNotificationSettings$outboundSchema), ), customerEmailSettings: z.optional( z.nullable(OrganizationCustomerEmailSettings$outboundSchema), ), customerPortalSettings: z.optional( z.nullable(OrganizationCustomerPortalSettings$outboundSchema), ), defaultPresentmentCurrency: z.optional( z.nullable(PresentmentCurrency$outboundSchema), ), defaultTaxBehavior: z.optional( z.nullable(TaxBehaviorOption$outboundSchema), ), }), z.transform((v) => { return remap$(v, { avatarUrl: "avatar_url", featureSettings: "feature_settings", subscriptionSettings: "subscription_settings", notificationSettings: "notification_settings", customerEmailSettings: "customer_email_settings", customerPortalSettings: "customer_portal_settings", defaultPresentmentCurrency: "default_presentment_currency", defaultTaxBehavior: "default_tax_behavior", }); }), ); export function organizationUpdateToJSON( organizationUpdate: OrganizationUpdate, ): string { return JSON.stringify( OrganizationUpdate$outboundSchema.parse(organizationUpdate), ); }