UNPKG

attio-js

Version:

Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.

1,220 lines (1,124 loc) 45.8 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { Attribute, Attribute$inboundSchema, Attribute$Outbound, Attribute$outboundSchema, } from "../components/attribute.js"; import { InputValueUnion, InputValueUnion$inboundSchema, InputValueUnion$Outbound, InputValueUnion$outboundSchema, } from "../components/inputvalueunion.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Whether the attribute is on an object or a list. */ export const PatchV2TargetIdentifierAttributesAttributeTarget = { Objects: "objects", Lists: "lists", } as const; /** * Whether the attribute is on an object or a list. */ export type PatchV2TargetIdentifierAttributesAttributeTarget = ClosedEnum< typeof PatchV2TargetIdentifierAttributesAttributeTarget >; export const PatchV2TargetIdentifierAttributesAttributeTypeStatic = { Static: "static", } as const; export type PatchV2TargetIdentifierAttributesAttributeTypeStatic = ClosedEnum< typeof PatchV2TargetIdentifierAttributesAttributeTypeStatic >; export type PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic = { type: PatchV2TargetIdentifierAttributesAttributeTypeStatic; template: Array<InputValueUnion>; }; export const PatchV2TargetIdentifierAttributesAttributeTypeDynamic = { Dynamic: "dynamic", } as const; export type PatchV2TargetIdentifierAttributesAttributeTypeDynamic = ClosedEnum< typeof PatchV2TargetIdentifierAttributesAttributeTypeDynamic >; /** * For actor reference attributes, you may pass a dynamic value of `"current-user"`. When creating new records or entries, this will cause the actor reference value to be populated with either the workspace member or API token that created the record/entry. */ export const PatchV2TargetIdentifierAttributesAttributeTemplate = { CurrentUser: "current-user", } as const; /** * For actor reference attributes, you may pass a dynamic value of `"current-user"`. When creating new records or entries, this will cause the actor reference value to be populated with either the workspace member or API token that created the record/entry. */ export type PatchV2TargetIdentifierAttributesAttributeTemplate = ClosedEnum< typeof PatchV2TargetIdentifierAttributesAttributeTemplate >; export type PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic = { type: PatchV2TargetIdentifierAttributesAttributeTypeDynamic; template?: any | undefined; }; /** * The default value for this attribute. Static values are used to directly populate values using their contents. Dynamic values are used to lookup data at the point of creation. For example, you could use a dynamic value to insert a value for the currently logged in user. Which default values are available is dependent on the type of the attribute. Default values are not currently supported on people or company objects. */ export type PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion = | PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic | PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic; /** * The ISO4217 code representing the currency that values for this attribute should be stored in. */ export const PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode = { Aud: "AUD", Brl: "BRL", Bel: "BEL", Cad: "CAD", Cny: "CNY", Cop: "COP", Czk: "CZK", Dkk: "DKK", Eur: "EUR", Hkd: "HKD", Isk: "ISK", Inr: "INR", Ils: "ILS", Jpy: "JPY", Krw: "KRW", Myr: "MYR", Mxn: "MXN", Ntd: "NTD", Nzd: "NZD", Ngn: "NGN", Nok: "NOK", Xpf: "XPF", Pen: "PEN", Php: "PHP", Pln: "PLN", Gbp: "GBP", Sar: "SAR", Sgd: "SGD", Zar: "ZAR", Sek: "SEK", Chf: "CHF", Aed: "AED", Usd: "USD", } as const; /** * The ISO4217 code representing the currency that values for this attribute should be stored in. */ export type PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode = ClosedEnum< typeof PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode >; /** * How the currency should be displayed across the app. "code" will display the ISO currency code e.g. "USD", "name" will display the localized currency name e.g. "British pound", "narrowSymbol" will display "$1" instead of "US$1" and "symbol" will display a localized currency symbol such as "$". */ export const PatchV2TargetIdentifierAttributesAttributeDisplayType = { Code: "code", Name: "name", NarrowSymbol: "narrowSymbol", Symbol: "symbol", } as const; /** * How the currency should be displayed across the app. "code" will display the ISO currency code e.g. "USD", "name" will display the localized currency name e.g. "British pound", "narrowSymbol" will display "$1" instead of "US$1" and "symbol" will display a localized currency symbol such as "$". */ export type PatchV2TargetIdentifierAttributesAttributeDisplayType = ClosedEnum< typeof PatchV2TargetIdentifierAttributesAttributeDisplayType >; /** * Configuration available for attributes of type "currency". */ export type PatchV2TargetIdentifierAttributesAttributeCurrency = { /** * The ISO4217 code representing the currency that values for this attribute should be stored in. */ defaultCurrencyCode: PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode; /** * How the currency should be displayed across the app. "code" will display the ISO currency code e.g. "USD", "name" will display the localized currency name e.g. "British pound", "narrowSymbol" will display "$1" instead of "US$1" and "symbol" will display a localized currency symbol such as "$". */ displayType: PatchV2TargetIdentifierAttributesAttributeDisplayType; }; /** * Configuration available for attributes of type "record-reference". */ export type PatchV2TargetIdentifierAttributesAttributeRecordReference = { /** * A list of slugs or UUIDs to indicate which objects records are allowed to belong to. Leave empty to to allow records from all object types. */ allowedObjects: Array<string>; }; /** * Additional, type-dependent configuration for the attribute. */ export type PatchV2TargetIdentifierAttributesAttributeConfig = { /** * Configuration available for attributes of type "currency". */ currency?: PatchV2TargetIdentifierAttributesAttributeCurrency | undefined; /** * Configuration available for attributes of type "record-reference". */ recordReference?: | PatchV2TargetIdentifierAttributesAttributeRecordReference | undefined; }; export type PatchV2TargetIdentifierAttributesAttributeData = { /** * The name of the attribute. The title will be visible across Attio's UI. */ title?: string | undefined; /** * A text description for the attribute. */ description?: string | null | undefined; /** * A unique, human-readable slug to access the attribute through URLs and API calls. Formatted in snake case. */ apiSlug?: string | undefined; /** * When `is_required` is `true`, new records/entries must have a value for this attribute. If `false`, values may be `null`. This value does not affect existing data and you do not need to backfill `null` values if changing `is_required` from `false` to `true`. */ isRequired?: boolean | undefined; /** * Whether or not new values for this attribute must be unique. Uniqueness restrictions are only applied to new data and do not apply retroactively to previously created data. */ isUnique?: boolean | undefined; /** * The default value for this attribute. Static values are used to directly populate values using their contents. Dynamic values are used to lookup data at the point of creation. For example, you could use a dynamic value to insert a value for the currently logged in user. Which default values are available is dependent on the type of the attribute. Default values are not currently supported on people or company objects. */ defaultValue?: | PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic | PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic | null | undefined; /** * Additional, type-dependent configuration for the attribute. */ config?: PatchV2TargetIdentifierAttributesAttributeConfig | undefined; /** * Whether the attribute has been archived or not. See our [archiving guide](/docs/archiving-vs-deleting) for more information on archiving. */ isArchived?: boolean | undefined; }; export type PatchV2TargetIdentifierAttributesAttributeRequestBody = { data: PatchV2TargetIdentifierAttributesAttributeData; }; export type PatchV2TargetIdentifierAttributesAttributeRequest = { /** * Whether the attribute is on an object or a list. */ target: PatchV2TargetIdentifierAttributesAttributeTarget; identifier: string; attribute: string; requestBody: PatchV2TargetIdentifierAttributesAttributeRequestBody; }; /** * Success */ export type PatchV2TargetIdentifierAttributesAttributeResponse = { data: Attribute; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeTarget$inboundSchema: z.ZodNativeEnum<typeof PatchV2TargetIdentifierAttributesAttributeTarget> = z .nativeEnum(PatchV2TargetIdentifierAttributesAttributeTarget); /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeTarget$outboundSchema: z.ZodNativeEnum<typeof PatchV2TargetIdentifierAttributesAttributeTarget> = PatchV2TargetIdentifierAttributesAttributeTarget$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeTarget$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeTarget$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeTarget$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeTarget$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeTarget$outboundSchema; } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeTypeStatic$inboundSchema: z.ZodNativeEnum<typeof PatchV2TargetIdentifierAttributesAttributeTypeStatic> = z.nativeEnum(PatchV2TargetIdentifierAttributesAttributeTypeStatic); /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeTypeStatic$outboundSchema: z.ZodNativeEnum<typeof PatchV2TargetIdentifierAttributesAttributeTypeStatic> = PatchV2TargetIdentifierAttributesAttributeTypeStatic$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeTypeStatic$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeTypeStatic$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeTypeStatic$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeTypeStatic$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeTypeStatic$outboundSchema; } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic, z.ZodTypeDef, unknown > = z.object({ type: PatchV2TargetIdentifierAttributesAttributeTypeStatic$inboundSchema, template: z.array(InputValueUnion$inboundSchema), }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$Outbound = { type: string; template: Array<InputValueUnion$Outbound>; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic > = z.object({ type: PatchV2TargetIdentifierAttributesAttributeTypeStatic$outboundSchema, template: z.array(InputValueUnion$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$Outbound; } export function patchV2TargetIdentifierAttributesAttributeDefaultValueStaticToJSON( patchV2TargetIdentifierAttributesAttributeDefaultValueStatic: PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$outboundSchema .parse(patchV2TargetIdentifierAttributesAttributeDefaultValueStatic), ); } export function patchV2TargetIdentifierAttributesAttributeDefaultValueStaticFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeTypeDynamic$inboundSchema: z.ZodNativeEnum< typeof PatchV2TargetIdentifierAttributesAttributeTypeDynamic > = z.nativeEnum(PatchV2TargetIdentifierAttributesAttributeTypeDynamic); /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeTypeDynamic$outboundSchema: z.ZodNativeEnum< typeof PatchV2TargetIdentifierAttributesAttributeTypeDynamic > = PatchV2TargetIdentifierAttributesAttributeTypeDynamic$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeTypeDynamic$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeTypeDynamic$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeTypeDynamic$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeTypeDynamic$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeTypeDynamic$outboundSchema; } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeTemplate$inboundSchema: z.ZodNativeEnum<typeof PatchV2TargetIdentifierAttributesAttributeTemplate> = z .nativeEnum(PatchV2TargetIdentifierAttributesAttributeTemplate); /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeTemplate$outboundSchema: z.ZodNativeEnum<typeof PatchV2TargetIdentifierAttributesAttributeTemplate> = PatchV2TargetIdentifierAttributesAttributeTemplate$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeTemplate$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeTemplate$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeTemplate$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeTemplate$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeTemplate$outboundSchema; } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic, z.ZodTypeDef, unknown > = z.object({ type: PatchV2TargetIdentifierAttributesAttributeTypeDynamic$inboundSchema, template: z.any().optional(), }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$Outbound = { type: string; template?: any | undefined; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic > = z.object({ type: PatchV2TargetIdentifierAttributesAttributeTypeDynamic$outboundSchema, template: z.any().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$Outbound; } export function patchV2TargetIdentifierAttributesAttributeDefaultValueDynamicToJSON( patchV2TargetIdentifierAttributesAttributeDefaultValueDynamic: PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$outboundSchema .parse(patchV2TargetIdentifierAttributesAttributeDefaultValueDynamic), ); } export function patchV2TargetIdentifierAttributesAttributeDefaultValueDynamicFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion, z.ZodTypeDef, unknown > = z.union([ z.lazy(() => PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$inboundSchema ), z.lazy(() => PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$inboundSchema ), ]); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$Outbound = | PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$Outbound | PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$Outbound; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion > = z.union([ z.lazy(() => PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$outboundSchema ), z.lazy(() => PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$outboundSchema ), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$Outbound; } export function patchV2TargetIdentifierAttributesAttributeDefaultValueUnionToJSON( patchV2TargetIdentifierAttributesAttributeDefaultValueUnion: PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$outboundSchema .parse(patchV2TargetIdentifierAttributesAttributeDefaultValueUnion), ); } export function patchV2TargetIdentifierAttributesAttributeDefaultValueUnionFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeDefaultValueUnion' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$inboundSchema: z.ZodNativeEnum< typeof PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode > = z.nativeEnum( PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode, ); /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$outboundSchema: z.ZodNativeEnum< typeof PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode > = PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$outboundSchema; } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDisplayType$inboundSchema: z.ZodNativeEnum< typeof PatchV2TargetIdentifierAttributesAttributeDisplayType > = z.nativeEnum(PatchV2TargetIdentifierAttributesAttributeDisplayType); /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeDisplayType$outboundSchema: z.ZodNativeEnum< typeof PatchV2TargetIdentifierAttributesAttributeDisplayType > = PatchV2TargetIdentifierAttributesAttributeDisplayType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeDisplayType$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDisplayType$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeDisplayType$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeDisplayType$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeDisplayType$outboundSchema; } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeCurrency$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeCurrency, z.ZodTypeDef, unknown > = z.object({ default_currency_code: PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$inboundSchema, display_type: PatchV2TargetIdentifierAttributesAttributeDisplayType$inboundSchema, }).transform((v) => { return remap$(v, { "default_currency_code": "defaultCurrencyCode", "display_type": "displayType", }); }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeCurrency$Outbound = { default_currency_code: string; display_type: string; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeCurrency$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeCurrency$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeCurrency > = z.object({ defaultCurrencyCode: PatchV2TargetIdentifierAttributesAttributeDefaultCurrencyCode$outboundSchema, displayType: PatchV2TargetIdentifierAttributesAttributeDisplayType$outboundSchema, }).transform((v) => { return remap$(v, { defaultCurrencyCode: "default_currency_code", displayType: "display_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeCurrency$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeCurrency$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeCurrency$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeCurrency$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeCurrency$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeCurrency$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeCurrency$Outbound; } export function patchV2TargetIdentifierAttributesAttributeCurrencyToJSON( patchV2TargetIdentifierAttributesAttributeCurrency: PatchV2TargetIdentifierAttributesAttributeCurrency, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeCurrency$outboundSchema.parse( patchV2TargetIdentifierAttributesAttributeCurrency, ), ); } export function patchV2TargetIdentifierAttributesAttributeCurrencyFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeCurrency, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeCurrency$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeCurrency' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeRecordReference$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeRecordReference, z.ZodTypeDef, unknown > = z.object({ allowed_objects: z.array(z.string()), }).transform((v) => { return remap$(v, { "allowed_objects": "allowedObjects", }); }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeRecordReference$Outbound = { allowed_objects: Array<string>; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeRecordReference$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeRecordReference$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeRecordReference > = z.object({ allowedObjects: z.array(z.string()), }).transform((v) => { return remap$(v, { allowedObjects: "allowed_objects", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeRecordReference$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRecordReference$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeRecordReference$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRecordReference$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeRecordReference$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRecordReference$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeRecordReference$Outbound; } export function patchV2TargetIdentifierAttributesAttributeRecordReferenceToJSON( patchV2TargetIdentifierAttributesAttributeRecordReference: PatchV2TargetIdentifierAttributesAttributeRecordReference, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeRecordReference$outboundSchema .parse(patchV2TargetIdentifierAttributesAttributeRecordReference), ); } export function patchV2TargetIdentifierAttributesAttributeRecordReferenceFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeRecordReference, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeRecordReference$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeRecordReference' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeConfig$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeConfig, z.ZodTypeDef, unknown > = z.object({ currency: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeCurrency$inboundSchema ).optional(), record_reference: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeRecordReference$inboundSchema ).optional(), }).transform((v) => { return remap$(v, { "record_reference": "recordReference", }); }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeConfig$Outbound = { currency?: | PatchV2TargetIdentifierAttributesAttributeCurrency$Outbound | undefined; record_reference?: | PatchV2TargetIdentifierAttributesAttributeRecordReference$Outbound | undefined; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeConfig$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeConfig$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeConfig > = z.object({ currency: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeCurrency$outboundSchema ).optional(), recordReference: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeRecordReference$outboundSchema ).optional(), }).transform((v) => { return remap$(v, { recordReference: "record_reference", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeConfig$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeConfig$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeConfig$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeConfig$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeConfig$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeConfig$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeConfig$Outbound; } export function patchV2TargetIdentifierAttributesAttributeConfigToJSON( patchV2TargetIdentifierAttributesAttributeConfig: PatchV2TargetIdentifierAttributesAttributeConfig, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeConfig$outboundSchema.parse( patchV2TargetIdentifierAttributesAttributeConfig, ), ); } export function patchV2TargetIdentifierAttributesAttributeConfigFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeConfig, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeConfig$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeConfig' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeData$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeData, z.ZodTypeDef, unknown > = z.object({ title: z.string().optional(), description: z.nullable(z.string()).optional(), api_slug: z.string().optional(), is_required: z.boolean().optional(), is_unique: z.boolean().optional(), default_value: z.nullable( z.union([ z.lazy(() => PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$inboundSchema ), z.lazy(() => PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$inboundSchema ), ]), ).optional(), config: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeConfig$inboundSchema ).optional(), is_archived: z.boolean().optional(), }).transform((v) => { return remap$(v, { "api_slug": "apiSlug", "is_required": "isRequired", "is_unique": "isUnique", "default_value": "defaultValue", "is_archived": "isArchived", }); }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeData$Outbound = { title?: string | undefined; description?: string | null | undefined; api_slug?: string | undefined; is_required?: boolean | undefined; is_unique?: boolean | undefined; default_value?: | PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$Outbound | PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$Outbound | null | undefined; config?: | PatchV2TargetIdentifierAttributesAttributeConfig$Outbound | undefined; is_archived?: boolean | undefined; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeData$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeData$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeData > = z.object({ title: z.string().optional(), description: z.nullable(z.string()).optional(), apiSlug: z.string().optional(), isRequired: z.boolean().optional(), isUnique: z.boolean().optional(), defaultValue: z.nullable( z.union([ z.lazy(() => PatchV2TargetIdentifierAttributesAttributeDefaultValueDynamic$outboundSchema ), z.lazy(() => PatchV2TargetIdentifierAttributesAttributeDefaultValueStatic$outboundSchema ), ]), ).optional(), config: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeConfig$outboundSchema ).optional(), isArchived: z.boolean().optional(), }).transform((v) => { return remap$(v, { apiSlug: "api_slug", isRequired: "is_required", isUnique: "is_unique", defaultValue: "default_value", isArchived: "is_archived", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeData$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeData$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeData$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeData$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeData$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeData$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeData$Outbound; } export function patchV2TargetIdentifierAttributesAttributeDataToJSON( patchV2TargetIdentifierAttributesAttributeData: PatchV2TargetIdentifierAttributesAttributeData, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeData$outboundSchema.parse( patchV2TargetIdentifierAttributesAttributeData, ), ); } export function patchV2TargetIdentifierAttributesAttributeDataFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeData, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeData$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeData' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeRequestBody$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeRequestBody, z.ZodTypeDef, unknown > = z.object({ data: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeData$inboundSchema ), }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeRequestBody$Outbound = { data: PatchV2TargetIdentifierAttributesAttributeData$Outbound; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeRequestBody$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeRequestBody$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeRequestBody > = z.object({ data: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeData$outboundSchema ), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeRequestBody$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRequestBody$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeRequestBody$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRequestBody$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeRequestBody$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRequestBody$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeRequestBody$Outbound; } export function patchV2TargetIdentifierAttributesAttributeRequestBodyToJSON( patchV2TargetIdentifierAttributesAttributeRequestBody: PatchV2TargetIdentifierAttributesAttributeRequestBody, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeRequestBody$outboundSchema.parse( patchV2TargetIdentifierAttributesAttributeRequestBody, ), ); } export function patchV2TargetIdentifierAttributesAttributeRequestBodyFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeRequestBody, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeRequestBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeRequestBody' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeRequest$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeRequest, z.ZodTypeDef, unknown > = z.object({ target: PatchV2TargetIdentifierAttributesAttributeTarget$inboundSchema, identifier: z.string(), attribute: z.string(), RequestBody: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeRequestBody$inboundSchema ), }).transform((v) => { return remap$(v, { "RequestBody": "requestBody", }); }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeRequest$Outbound = { target: string; identifier: string; attribute: string; RequestBody: PatchV2TargetIdentifierAttributesAttributeRequestBody$Outbound; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeRequest$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeRequest$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeRequest > = z.object({ target: PatchV2TargetIdentifierAttributesAttributeTarget$outboundSchema, identifier: z.string(), attribute: z.string(), requestBody: z.lazy(() => PatchV2TargetIdentifierAttributesAttributeRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeRequest$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeRequest$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeRequest$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeRequest$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeRequest$Outbound; } export function patchV2TargetIdentifierAttributesAttributeRequestToJSON( patchV2TargetIdentifierAttributesAttributeRequest: PatchV2TargetIdentifierAttributesAttributeRequest, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeRequest$outboundSchema.parse( patchV2TargetIdentifierAttributesAttributeRequest, ), ); } export function patchV2TargetIdentifierAttributesAttributeRequestFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeRequest, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeRequest' from JSON`, ); } /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeResponse$inboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeResponse, z.ZodTypeDef, unknown > = z.object({ data: Attribute$inboundSchema, }); /** @internal */ export type PatchV2TargetIdentifierAttributesAttributeResponse$Outbound = { data: Attribute$Outbound; }; /** @internal */ export const PatchV2TargetIdentifierAttributesAttributeResponse$outboundSchema: z.ZodType< PatchV2TargetIdentifierAttributesAttributeResponse$Outbound, z.ZodTypeDef, PatchV2TargetIdentifierAttributesAttributeResponse > = z.object({ data: Attribute$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2TargetIdentifierAttributesAttributeResponse$ { /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeResponse$inboundSchema` instead. */ export const inboundSchema = PatchV2TargetIdentifierAttributesAttributeResponse$inboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeResponse$outboundSchema` instead. */ export const outboundSchema = PatchV2TargetIdentifierAttributesAttributeResponse$outboundSchema; /** @deprecated use `PatchV2TargetIdentifierAttributesAttributeResponse$Outbound` instead. */ export type Outbound = PatchV2TargetIdentifierAttributesAttributeResponse$Outbound; } export function patchV2TargetIdentifierAttributesAttributeResponseToJSON( patchV2TargetIdentifierAttributesAttributeResponse: PatchV2TargetIdentifierAttributesAttributeResponse, ): string { return JSON.stringify( PatchV2TargetIdentifierAttributesAttributeResponse$outboundSchema.parse( patchV2TargetIdentifierAttributesAttributeResponse, ), ); } export function patchV2TargetIdentifierAttributesAttributeResponseFromJSON( jsonString: string, ): SafeParseResult< PatchV2TargetIdentifierAttributesAttributeResponse, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2TargetIdentifierAttributesAttributeResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2TargetIdentifierAttributesAttributeResponse' from JSON`, ); }