attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
541 lines • 31 kB
JavaScript
/*
* 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 { Attribute$inboundSchema, Attribute$outboundSchema, } from "../components/attribute.js";
import { InputValueUnion$inboundSchema, InputValueUnion$outboundSchema, } from "../components/inputvalueunion.js";
/**
* Whether the attribute is to be created on an object or a list.
*/
export const PostV2TargetIdentifierAttributesTarget = {
Objects: "objects",
Lists: "lists",
};
/**
* The type of the attribute. This value affects the possible `config` values. Attributes of type "status" are not supported on objects.
*/
export const PostV2TargetIdentifierAttributesType = {
Text: "text",
Number: "number",
Checkbox: "checkbox",
Currency: "currency",
Date: "date",
Timestamp: "timestamp",
Rating: "rating",
Status: "status",
Select: "select",
RecordReference: "record-reference",
ActorReference: "actor-reference",
Location: "location",
Domain: "domain",
EmailAddress: "email-address",
PhoneNumber: "phone-number",
};
export const PostV2TargetIdentifierAttributesTypeStatic = {
Static: "static",
};
export const PostV2TargetIdentifierAttributesTypeDynamic = {
Dynamic: "dynamic",
};
/**
* 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 PostV2TargetIdentifierAttributesTemplate = {
CurrentUser: "current-user",
};
/**
* The ISO4217 code representing the currency that values for this attribute should be stored in.
*/
export const PostV2TargetIdentifierAttributesDefaultCurrencyCode = {
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",
};
/**
* 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 PostV2TargetIdentifierAttributesDisplayType = {
Code: "code",
Name: "name",
NarrowSymbol: "narrowSymbol",
Symbol: "symbol",
};
/** @internal */
export const PostV2TargetIdentifierAttributesTarget$inboundSchema = z.nativeEnum(PostV2TargetIdentifierAttributesTarget);
/** @internal */
export const PostV2TargetIdentifierAttributesTarget$outboundSchema = PostV2TargetIdentifierAttributesTarget$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesTarget$;
(function (PostV2TargetIdentifierAttributesTarget$) {
/** @deprecated use `PostV2TargetIdentifierAttributesTarget$inboundSchema` instead. */
PostV2TargetIdentifierAttributesTarget$.inboundSchema = PostV2TargetIdentifierAttributesTarget$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesTarget$outboundSchema` instead. */
PostV2TargetIdentifierAttributesTarget$.outboundSchema = PostV2TargetIdentifierAttributesTarget$outboundSchema;
})(PostV2TargetIdentifierAttributesTarget$ || (PostV2TargetIdentifierAttributesTarget$ = {}));
/** @internal */
export const PostV2TargetIdentifierAttributesType$inboundSchema = z.nativeEnum(PostV2TargetIdentifierAttributesType);
/** @internal */
export const PostV2TargetIdentifierAttributesType$outboundSchema = PostV2TargetIdentifierAttributesType$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesType$;
(function (PostV2TargetIdentifierAttributesType$) {
/** @deprecated use `PostV2TargetIdentifierAttributesType$inboundSchema` instead. */
PostV2TargetIdentifierAttributesType$.inboundSchema = PostV2TargetIdentifierAttributesType$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesType$outboundSchema` instead. */
PostV2TargetIdentifierAttributesType$.outboundSchema = PostV2TargetIdentifierAttributesType$outboundSchema;
})(PostV2TargetIdentifierAttributesType$ || (PostV2TargetIdentifierAttributesType$ = {}));
/** @internal */
export const PostV2TargetIdentifierAttributesTypeStatic$inboundSchema = z
.nativeEnum(PostV2TargetIdentifierAttributesTypeStatic);
/** @internal */
export const PostV2TargetIdentifierAttributesTypeStatic$outboundSchema = PostV2TargetIdentifierAttributesTypeStatic$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesTypeStatic$;
(function (PostV2TargetIdentifierAttributesTypeStatic$) {
/** @deprecated use `PostV2TargetIdentifierAttributesTypeStatic$inboundSchema` instead. */
PostV2TargetIdentifierAttributesTypeStatic$.inboundSchema = PostV2TargetIdentifierAttributesTypeStatic$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesTypeStatic$outboundSchema` instead. */
PostV2TargetIdentifierAttributesTypeStatic$.outboundSchema = PostV2TargetIdentifierAttributesTypeStatic$outboundSchema;
})(PostV2TargetIdentifierAttributesTypeStatic$ || (PostV2TargetIdentifierAttributesTypeStatic$ = {}));
/** @internal */
export const PostV2TargetIdentifierAttributesDefaultValueStatic$inboundSchema = z.object({
type: PostV2TargetIdentifierAttributesTypeStatic$inboundSchema,
template: z.array(InputValueUnion$inboundSchema),
});
/** @internal */
export const PostV2TargetIdentifierAttributesDefaultValueStatic$outboundSchema = z.object({
type: PostV2TargetIdentifierAttributesTypeStatic$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 var PostV2TargetIdentifierAttributesDefaultValueStatic$;
(function (PostV2TargetIdentifierAttributesDefaultValueStatic$) {
/** @deprecated use `PostV2TargetIdentifierAttributesDefaultValueStatic$inboundSchema` instead. */
PostV2TargetIdentifierAttributesDefaultValueStatic$.inboundSchema = PostV2TargetIdentifierAttributesDefaultValueStatic$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesDefaultValueStatic$outboundSchema` instead. */
PostV2TargetIdentifierAttributesDefaultValueStatic$.outboundSchema = PostV2TargetIdentifierAttributesDefaultValueStatic$outboundSchema;
})(PostV2TargetIdentifierAttributesDefaultValueStatic$ || (PostV2TargetIdentifierAttributesDefaultValueStatic$ = {}));
export function postV2TargetIdentifierAttributesDefaultValueStaticToJSON(postV2TargetIdentifierAttributesDefaultValueStatic) {
return JSON.stringify(PostV2TargetIdentifierAttributesDefaultValueStatic$outboundSchema.parse(postV2TargetIdentifierAttributesDefaultValueStatic));
}
export function postV2TargetIdentifierAttributesDefaultValueStaticFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesDefaultValueStatic$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesDefaultValueStatic' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesTypeDynamic$inboundSchema = z
.nativeEnum(PostV2TargetIdentifierAttributesTypeDynamic);
/** @internal */
export const PostV2TargetIdentifierAttributesTypeDynamic$outboundSchema = PostV2TargetIdentifierAttributesTypeDynamic$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesTypeDynamic$;
(function (PostV2TargetIdentifierAttributesTypeDynamic$) {
/** @deprecated use `PostV2TargetIdentifierAttributesTypeDynamic$inboundSchema` instead. */
PostV2TargetIdentifierAttributesTypeDynamic$.inboundSchema = PostV2TargetIdentifierAttributesTypeDynamic$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesTypeDynamic$outboundSchema` instead. */
PostV2TargetIdentifierAttributesTypeDynamic$.outboundSchema = PostV2TargetIdentifierAttributesTypeDynamic$outboundSchema;
})(PostV2TargetIdentifierAttributesTypeDynamic$ || (PostV2TargetIdentifierAttributesTypeDynamic$ = {}));
/** @internal */
export const PostV2TargetIdentifierAttributesTemplate$inboundSchema = z
.nativeEnum(PostV2TargetIdentifierAttributesTemplate);
/** @internal */
export const PostV2TargetIdentifierAttributesTemplate$outboundSchema = PostV2TargetIdentifierAttributesTemplate$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesTemplate$;
(function (PostV2TargetIdentifierAttributesTemplate$) {
/** @deprecated use `PostV2TargetIdentifierAttributesTemplate$inboundSchema` instead. */
PostV2TargetIdentifierAttributesTemplate$.inboundSchema = PostV2TargetIdentifierAttributesTemplate$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesTemplate$outboundSchema` instead. */
PostV2TargetIdentifierAttributesTemplate$.outboundSchema = PostV2TargetIdentifierAttributesTemplate$outboundSchema;
})(PostV2TargetIdentifierAttributesTemplate$ || (PostV2TargetIdentifierAttributesTemplate$ = {}));
/** @internal */
export const PostV2TargetIdentifierAttributesDefaultValueDynamic$inboundSchema = z.object({
type: PostV2TargetIdentifierAttributesTypeDynamic$inboundSchema,
template: z.any().optional(),
});
/** @internal */
export const PostV2TargetIdentifierAttributesDefaultValueDynamic$outboundSchema = z.object({
type: PostV2TargetIdentifierAttributesTypeDynamic$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 var PostV2TargetIdentifierAttributesDefaultValueDynamic$;
(function (PostV2TargetIdentifierAttributesDefaultValueDynamic$) {
/** @deprecated use `PostV2TargetIdentifierAttributesDefaultValueDynamic$inboundSchema` instead. */
PostV2TargetIdentifierAttributesDefaultValueDynamic$.inboundSchema = PostV2TargetIdentifierAttributesDefaultValueDynamic$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesDefaultValueDynamic$outboundSchema` instead. */
PostV2TargetIdentifierAttributesDefaultValueDynamic$.outboundSchema = PostV2TargetIdentifierAttributesDefaultValueDynamic$outboundSchema;
})(PostV2TargetIdentifierAttributesDefaultValueDynamic$ || (PostV2TargetIdentifierAttributesDefaultValueDynamic$ = {}));
export function postV2TargetIdentifierAttributesDefaultValueDynamicToJSON(postV2TargetIdentifierAttributesDefaultValueDynamic) {
return JSON.stringify(PostV2TargetIdentifierAttributesDefaultValueDynamic$outboundSchema.parse(postV2TargetIdentifierAttributesDefaultValueDynamic));
}
export function postV2TargetIdentifierAttributesDefaultValueDynamicFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesDefaultValueDynamic$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesDefaultValueDynamic' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesDefaultValueUnion$inboundSchema = z.union([
z.lazy(() => PostV2TargetIdentifierAttributesDefaultValueDynamic$inboundSchema),
z.lazy(() => PostV2TargetIdentifierAttributesDefaultValueStatic$inboundSchema),
]);
/** @internal */
export const PostV2TargetIdentifierAttributesDefaultValueUnion$outboundSchema = z.union([
z.lazy(() => PostV2TargetIdentifierAttributesDefaultValueDynamic$outboundSchema),
z.lazy(() => PostV2TargetIdentifierAttributesDefaultValueStatic$outboundSchema),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesDefaultValueUnion$;
(function (PostV2TargetIdentifierAttributesDefaultValueUnion$) {
/** @deprecated use `PostV2TargetIdentifierAttributesDefaultValueUnion$inboundSchema` instead. */
PostV2TargetIdentifierAttributesDefaultValueUnion$.inboundSchema = PostV2TargetIdentifierAttributesDefaultValueUnion$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesDefaultValueUnion$outboundSchema` instead. */
PostV2TargetIdentifierAttributesDefaultValueUnion$.outboundSchema = PostV2TargetIdentifierAttributesDefaultValueUnion$outboundSchema;
})(PostV2TargetIdentifierAttributesDefaultValueUnion$ || (PostV2TargetIdentifierAttributesDefaultValueUnion$ = {}));
export function postV2TargetIdentifierAttributesDefaultValueUnionToJSON(postV2TargetIdentifierAttributesDefaultValueUnion) {
return JSON.stringify(PostV2TargetIdentifierAttributesDefaultValueUnion$outboundSchema.parse(postV2TargetIdentifierAttributesDefaultValueUnion));
}
export function postV2TargetIdentifierAttributesDefaultValueUnionFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesDefaultValueUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesDefaultValueUnion' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesDefaultCurrencyCode$inboundSchema = z.nativeEnum(PostV2TargetIdentifierAttributesDefaultCurrencyCode);
/** @internal */
export const PostV2TargetIdentifierAttributesDefaultCurrencyCode$outboundSchema = PostV2TargetIdentifierAttributesDefaultCurrencyCode$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesDefaultCurrencyCode$;
(function (PostV2TargetIdentifierAttributesDefaultCurrencyCode$) {
/** @deprecated use `PostV2TargetIdentifierAttributesDefaultCurrencyCode$inboundSchema` instead. */
PostV2TargetIdentifierAttributesDefaultCurrencyCode$.inboundSchema = PostV2TargetIdentifierAttributesDefaultCurrencyCode$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesDefaultCurrencyCode$outboundSchema` instead. */
PostV2TargetIdentifierAttributesDefaultCurrencyCode$.outboundSchema = PostV2TargetIdentifierAttributesDefaultCurrencyCode$outboundSchema;
})(PostV2TargetIdentifierAttributesDefaultCurrencyCode$ || (PostV2TargetIdentifierAttributesDefaultCurrencyCode$ = {}));
/** @internal */
export const PostV2TargetIdentifierAttributesDisplayType$inboundSchema = z
.nativeEnum(PostV2TargetIdentifierAttributesDisplayType);
/** @internal */
export const PostV2TargetIdentifierAttributesDisplayType$outboundSchema = PostV2TargetIdentifierAttributesDisplayType$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesDisplayType$;
(function (PostV2TargetIdentifierAttributesDisplayType$) {
/** @deprecated use `PostV2TargetIdentifierAttributesDisplayType$inboundSchema` instead. */
PostV2TargetIdentifierAttributesDisplayType$.inboundSchema = PostV2TargetIdentifierAttributesDisplayType$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesDisplayType$outboundSchema` instead. */
PostV2TargetIdentifierAttributesDisplayType$.outboundSchema = PostV2TargetIdentifierAttributesDisplayType$outboundSchema;
})(PostV2TargetIdentifierAttributesDisplayType$ || (PostV2TargetIdentifierAttributesDisplayType$ = {}));
/** @internal */
export const PostV2TargetIdentifierAttributesCurrency$inboundSchema = z.object({
default_currency_code: PostV2TargetIdentifierAttributesDefaultCurrencyCode$inboundSchema,
display_type: PostV2TargetIdentifierAttributesDisplayType$inboundSchema,
}).transform((v) => {
return remap$(v, {
"default_currency_code": "defaultCurrencyCode",
"display_type": "displayType",
});
});
/** @internal */
export const PostV2TargetIdentifierAttributesCurrency$outboundSchema = z.object({
defaultCurrencyCode: PostV2TargetIdentifierAttributesDefaultCurrencyCode$outboundSchema,
displayType: PostV2TargetIdentifierAttributesDisplayType$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 var PostV2TargetIdentifierAttributesCurrency$;
(function (PostV2TargetIdentifierAttributesCurrency$) {
/** @deprecated use `PostV2TargetIdentifierAttributesCurrency$inboundSchema` instead. */
PostV2TargetIdentifierAttributesCurrency$.inboundSchema = PostV2TargetIdentifierAttributesCurrency$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesCurrency$outboundSchema` instead. */
PostV2TargetIdentifierAttributesCurrency$.outboundSchema = PostV2TargetIdentifierAttributesCurrency$outboundSchema;
})(PostV2TargetIdentifierAttributesCurrency$ || (PostV2TargetIdentifierAttributesCurrency$ = {}));
export function postV2TargetIdentifierAttributesCurrencyToJSON(postV2TargetIdentifierAttributesCurrency) {
return JSON.stringify(PostV2TargetIdentifierAttributesCurrency$outboundSchema.parse(postV2TargetIdentifierAttributesCurrency));
}
export function postV2TargetIdentifierAttributesCurrencyFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesCurrency$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesCurrency' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesRecordReference$inboundSchema = z.object({
allowed_objects: z.array(z.string()),
}).transform((v) => {
return remap$(v, {
"allowed_objects": "allowedObjects",
});
});
/** @internal */
export const PostV2TargetIdentifierAttributesRecordReference$outboundSchema = 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 var PostV2TargetIdentifierAttributesRecordReference$;
(function (PostV2TargetIdentifierAttributesRecordReference$) {
/** @deprecated use `PostV2TargetIdentifierAttributesRecordReference$inboundSchema` instead. */
PostV2TargetIdentifierAttributesRecordReference$.inboundSchema = PostV2TargetIdentifierAttributesRecordReference$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesRecordReference$outboundSchema` instead. */
PostV2TargetIdentifierAttributesRecordReference$.outboundSchema = PostV2TargetIdentifierAttributesRecordReference$outboundSchema;
})(PostV2TargetIdentifierAttributesRecordReference$ || (PostV2TargetIdentifierAttributesRecordReference$ = {}));
export function postV2TargetIdentifierAttributesRecordReferenceToJSON(postV2TargetIdentifierAttributesRecordReference) {
return JSON.stringify(PostV2TargetIdentifierAttributesRecordReference$outboundSchema.parse(postV2TargetIdentifierAttributesRecordReference));
}
export function postV2TargetIdentifierAttributesRecordReferenceFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesRecordReference$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesRecordReference' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesConfig$inboundSchema = z.object({
currency: z.lazy(() => PostV2TargetIdentifierAttributesCurrency$inboundSchema)
.optional(),
record_reference: z.lazy(() => PostV2TargetIdentifierAttributesRecordReference$inboundSchema).optional(),
}).transform((v) => {
return remap$(v, {
"record_reference": "recordReference",
});
});
/** @internal */
export const PostV2TargetIdentifierAttributesConfig$outboundSchema = z.object({
currency: z.lazy(() => PostV2TargetIdentifierAttributesCurrency$outboundSchema).optional(),
recordReference: z.lazy(() => PostV2TargetIdentifierAttributesRecordReference$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 var PostV2TargetIdentifierAttributesConfig$;
(function (PostV2TargetIdentifierAttributesConfig$) {
/** @deprecated use `PostV2TargetIdentifierAttributesConfig$inboundSchema` instead. */
PostV2TargetIdentifierAttributesConfig$.inboundSchema = PostV2TargetIdentifierAttributesConfig$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesConfig$outboundSchema` instead. */
PostV2TargetIdentifierAttributesConfig$.outboundSchema = PostV2TargetIdentifierAttributesConfig$outboundSchema;
})(PostV2TargetIdentifierAttributesConfig$ || (PostV2TargetIdentifierAttributesConfig$ = {}));
export function postV2TargetIdentifierAttributesConfigToJSON(postV2TargetIdentifierAttributesConfig) {
return JSON.stringify(PostV2TargetIdentifierAttributesConfig$outboundSchema.parse(postV2TargetIdentifierAttributesConfig));
}
export function postV2TargetIdentifierAttributesConfigFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesConfig' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesData$inboundSchema = z.object({
title: z.string(),
description: z.nullable(z.string()),
api_slug: z.string(),
type: PostV2TargetIdentifierAttributesType$inboundSchema,
is_required: z.boolean(),
is_unique: z.boolean(),
is_multiselect: z.boolean(),
default_value: z.nullable(z.union([
z.lazy(() => PostV2TargetIdentifierAttributesDefaultValueDynamic$inboundSchema),
z.lazy(() => PostV2TargetIdentifierAttributesDefaultValueStatic$inboundSchema),
])).optional(),
config: z.lazy(() => PostV2TargetIdentifierAttributesConfig$inboundSchema),
}).transform((v) => {
return remap$(v, {
"api_slug": "apiSlug",
"is_required": "isRequired",
"is_unique": "isUnique",
"is_multiselect": "isMultiselect",
"default_value": "defaultValue",
});
});
/** @internal */
export const PostV2TargetIdentifierAttributesData$outboundSchema = z.object({
title: z.string(),
description: z.nullable(z.string()),
apiSlug: z.string(),
type: PostV2TargetIdentifierAttributesType$outboundSchema,
isRequired: z.boolean(),
isUnique: z.boolean(),
isMultiselect: z.boolean(),
defaultValue: z.nullable(z.union([
z.lazy(() => PostV2TargetIdentifierAttributesDefaultValueDynamic$outboundSchema),
z.lazy(() => PostV2TargetIdentifierAttributesDefaultValueStatic$outboundSchema),
])).optional(),
config: z.lazy(() => PostV2TargetIdentifierAttributesConfig$outboundSchema),
}).transform((v) => {
return remap$(v, {
apiSlug: "api_slug",
isRequired: "is_required",
isUnique: "is_unique",
isMultiselect: "is_multiselect",
defaultValue: "default_value",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesData$;
(function (PostV2TargetIdentifierAttributesData$) {
/** @deprecated use `PostV2TargetIdentifierAttributesData$inboundSchema` instead. */
PostV2TargetIdentifierAttributesData$.inboundSchema = PostV2TargetIdentifierAttributesData$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesData$outboundSchema` instead. */
PostV2TargetIdentifierAttributesData$.outboundSchema = PostV2TargetIdentifierAttributesData$outboundSchema;
})(PostV2TargetIdentifierAttributesData$ || (PostV2TargetIdentifierAttributesData$ = {}));
export function postV2TargetIdentifierAttributesDataToJSON(postV2TargetIdentifierAttributesData) {
return JSON.stringify(PostV2TargetIdentifierAttributesData$outboundSchema.parse(postV2TargetIdentifierAttributesData));
}
export function postV2TargetIdentifierAttributesDataFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesData' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesRequestBody$inboundSchema = z.object({
data: z.lazy(() => PostV2TargetIdentifierAttributesData$inboundSchema),
});
/** @internal */
export const PostV2TargetIdentifierAttributesRequestBody$outboundSchema = z.object({
data: z.lazy(() => PostV2TargetIdentifierAttributesData$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2TargetIdentifierAttributesRequestBody$;
(function (PostV2TargetIdentifierAttributesRequestBody$) {
/** @deprecated use `PostV2TargetIdentifierAttributesRequestBody$inboundSchema` instead. */
PostV2TargetIdentifierAttributesRequestBody$.inboundSchema = PostV2TargetIdentifierAttributesRequestBody$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesRequestBody$outboundSchema` instead. */
PostV2TargetIdentifierAttributesRequestBody$.outboundSchema = PostV2TargetIdentifierAttributesRequestBody$outboundSchema;
})(PostV2TargetIdentifierAttributesRequestBody$ || (PostV2TargetIdentifierAttributesRequestBody$ = {}));
export function postV2TargetIdentifierAttributesRequestBodyToJSON(postV2TargetIdentifierAttributesRequestBody) {
return JSON.stringify(PostV2TargetIdentifierAttributesRequestBody$outboundSchema.parse(postV2TargetIdentifierAttributesRequestBody));
}
export function postV2TargetIdentifierAttributesRequestBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesRequestBody' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesRequest$inboundSchema = z.object({
target: PostV2TargetIdentifierAttributesTarget$inboundSchema,
identifier: z.string(),
RequestBody: z.lazy(() => PostV2TargetIdentifierAttributesRequestBody$inboundSchema),
}).transform((v) => {
return remap$(v, {
"RequestBody": "requestBody",
});
});
/** @internal */
export const PostV2TargetIdentifierAttributesRequest$outboundSchema = z.object({
target: PostV2TargetIdentifierAttributesTarget$outboundSchema,
identifier: z.string(),
requestBody: z.lazy(() => PostV2TargetIdentifierAttributesRequestBody$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 var PostV2TargetIdentifierAttributesRequest$;
(function (PostV2TargetIdentifierAttributesRequest$) {
/** @deprecated use `PostV2TargetIdentifierAttributesRequest$inboundSchema` instead. */
PostV2TargetIdentifierAttributesRequest$.inboundSchema = PostV2TargetIdentifierAttributesRequest$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesRequest$outboundSchema` instead. */
PostV2TargetIdentifierAttributesRequest$.outboundSchema = PostV2TargetIdentifierAttributesRequest$outboundSchema;
})(PostV2TargetIdentifierAttributesRequest$ || (PostV2TargetIdentifierAttributesRequest$ = {}));
export function postV2TargetIdentifierAttributesRequestToJSON(postV2TargetIdentifierAttributesRequest) {
return JSON.stringify(PostV2TargetIdentifierAttributesRequest$outboundSchema.parse(postV2TargetIdentifierAttributesRequest));
}
export function postV2TargetIdentifierAttributesRequestFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesRequest' from JSON`);
}
/** @internal */
export const PostV2TargetIdentifierAttributesResponse$inboundSchema = z.object({
data: Attribute$inboundSchema,
});
/** @internal */
export const PostV2TargetIdentifierAttributesResponse$outboundSchema = 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 var PostV2TargetIdentifierAttributesResponse$;
(function (PostV2TargetIdentifierAttributesResponse$) {
/** @deprecated use `PostV2TargetIdentifierAttributesResponse$inboundSchema` instead. */
PostV2TargetIdentifierAttributesResponse$.inboundSchema = PostV2TargetIdentifierAttributesResponse$inboundSchema;
/** @deprecated use `PostV2TargetIdentifierAttributesResponse$outboundSchema` instead. */
PostV2TargetIdentifierAttributesResponse$.outboundSchema = PostV2TargetIdentifierAttributesResponse$outboundSchema;
})(PostV2TargetIdentifierAttributesResponse$ || (PostV2TargetIdentifierAttributesResponse$ = {}));
export function postV2TargetIdentifierAttributesResponseToJSON(postV2TargetIdentifierAttributesResponse) {
return JSON.stringify(PostV2TargetIdentifierAttributesResponse$outboundSchema.parse(postV2TargetIdentifierAttributesResponse));
}
export function postV2TargetIdentifierAttributesResponseFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2TargetIdentifierAttributesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2TargetIdentifierAttributesResponse' from JSON`);
}
//# sourceMappingURL=postv2targetidentifierattributes.js.map