UNPKG

attio-js

Version:

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

596 lines 29.1 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"; /** * Type of event the webhook is subscribed to. */ export const GetV2WebhooksEventType = { CommentCreated: "comment.created", CommentResolved: "comment.resolved", CommentUnresolved: "comment.unresolved", CommentDeleted: "comment.deleted", ListCreated: "list.created", ListUpdated: "list.updated", ListDeleted: "list.deleted", ListAttributeCreated: "list-attribute.created", ListAttributeUpdated: "list-attribute.updated", ListEntryCreated: "list-entry.created", ListEntryUpdated: "list-entry.updated", ListEntryDeleted: "list-entry.deleted", ObjectAttributeCreated: "object-attribute.created", ObjectAttributeUpdated: "object-attribute.updated", NoteCreated: "note.created", NoteUpdated: "note.updated", NoteDeleted: "note.deleted", RecordCreated: "record.created", RecordMerged: "record.merged", RecordUpdated: "record.updated", RecordDeleted: "record.deleted", TaskCreated: "task.created", TaskUpdated: "task.updated", TaskDeleted: "task.deleted", WorkspaceMemberCreated: "workspace-member.created", }; export const GetV2WebhooksDollarAndOperatorNotEquals = { NotEquals: "not_equals", }; export const GetV2WebhooksDollarAndOperatorEquals = { Equals: "equals", }; export const GetV2WebhooksDollarOrOperatorNotEquals = { NotEquals: "not_equals", }; export const GetV2WebhooksDollarOrOperatorEquals = { Equals: "equals", }; /** * The state of the webhook. Webhooks marked as active and degraded will receive events, inactive ones will not. If a webhook remains in the degraded state for 7 days, it will be marked inactive. */ export const GetV2WebhooksStatus = { Active: "active", Degraded: "degraded", Inactive: "inactive", }; /** @internal */ export const GetV2WebhooksRequest$inboundSchema = z.object({ limit: z.number().int().optional(), offset: z.number().int().optional(), }); /** @internal */ export const GetV2WebhooksRequest$outboundSchema = z.object({ limit: z.number().int().optional(), offset: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksRequest$; (function (GetV2WebhooksRequest$) { /** @deprecated use `GetV2WebhooksRequest$inboundSchema` instead. */ GetV2WebhooksRequest$.inboundSchema = GetV2WebhooksRequest$inboundSchema; /** @deprecated use `GetV2WebhooksRequest$outboundSchema` instead. */ GetV2WebhooksRequest$.outboundSchema = GetV2WebhooksRequest$outboundSchema; })(GetV2WebhooksRequest$ || (GetV2WebhooksRequest$ = {})); export function getV2WebhooksRequestToJSON(getV2WebhooksRequest) { return JSON.stringify(GetV2WebhooksRequest$outboundSchema.parse(getV2WebhooksRequest)); } export function getV2WebhooksRequestFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksRequest' from JSON`); } /** @internal */ export const GetV2WebhooksEventType$inboundSchema = z.nativeEnum(GetV2WebhooksEventType); /** @internal */ export const GetV2WebhooksEventType$outboundSchema = GetV2WebhooksEventType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksEventType$; (function (GetV2WebhooksEventType$) { /** @deprecated use `GetV2WebhooksEventType$inboundSchema` instead. */ GetV2WebhooksEventType$.inboundSchema = GetV2WebhooksEventType$inboundSchema; /** @deprecated use `GetV2WebhooksEventType$outboundSchema` instead. */ GetV2WebhooksEventType$.outboundSchema = GetV2WebhooksEventType$outboundSchema; })(GetV2WebhooksEventType$ || (GetV2WebhooksEventType$ = {})); /** @internal */ export const GetV2WebhooksDollarAndOperatorNotEquals$inboundSchema = z .nativeEnum(GetV2WebhooksDollarAndOperatorNotEquals); /** @internal */ export const GetV2WebhooksDollarAndOperatorNotEquals$outboundSchema = GetV2WebhooksDollarAndOperatorNotEquals$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarAndOperatorNotEquals$; (function (GetV2WebhooksDollarAndOperatorNotEquals$) { /** @deprecated use `GetV2WebhooksDollarAndOperatorNotEquals$inboundSchema` instead. */ GetV2WebhooksDollarAndOperatorNotEquals$.inboundSchema = GetV2WebhooksDollarAndOperatorNotEquals$inboundSchema; /** @deprecated use `GetV2WebhooksDollarAndOperatorNotEquals$outboundSchema` instead. */ GetV2WebhooksDollarAndOperatorNotEquals$.outboundSchema = GetV2WebhooksDollarAndOperatorNotEquals$outboundSchema; })(GetV2WebhooksDollarAndOperatorNotEquals$ || (GetV2WebhooksDollarAndOperatorNotEquals$ = {})); /** @internal */ export const GetV2WebhooksDollarAndNotEquals$inboundSchema = z.object({ field: z.string(), operator: GetV2WebhooksDollarAndOperatorNotEquals$inboundSchema, value: z.string(), }); /** @internal */ export const GetV2WebhooksDollarAndNotEquals$outboundSchema = z.object({ field: z.string(), operator: GetV2WebhooksDollarAndOperatorNotEquals$outboundSchema, value: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarAndNotEquals$; (function (GetV2WebhooksDollarAndNotEquals$) { /** @deprecated use `GetV2WebhooksDollarAndNotEquals$inboundSchema` instead. */ GetV2WebhooksDollarAndNotEquals$.inboundSchema = GetV2WebhooksDollarAndNotEquals$inboundSchema; /** @deprecated use `GetV2WebhooksDollarAndNotEquals$outboundSchema` instead. */ GetV2WebhooksDollarAndNotEquals$.outboundSchema = GetV2WebhooksDollarAndNotEquals$outboundSchema; })(GetV2WebhooksDollarAndNotEquals$ || (GetV2WebhooksDollarAndNotEquals$ = {})); export function getV2WebhooksDollarAndNotEqualsToJSON(getV2WebhooksDollarAndNotEquals) { return JSON.stringify(GetV2WebhooksDollarAndNotEquals$outboundSchema.parse(getV2WebhooksDollarAndNotEquals)); } export function getV2WebhooksDollarAndNotEqualsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksDollarAndNotEquals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksDollarAndNotEquals' from JSON`); } /** @internal */ export const GetV2WebhooksDollarAndOperatorEquals$inboundSchema = z.nativeEnum(GetV2WebhooksDollarAndOperatorEquals); /** @internal */ export const GetV2WebhooksDollarAndOperatorEquals$outboundSchema = GetV2WebhooksDollarAndOperatorEquals$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarAndOperatorEquals$; (function (GetV2WebhooksDollarAndOperatorEquals$) { /** @deprecated use `GetV2WebhooksDollarAndOperatorEquals$inboundSchema` instead. */ GetV2WebhooksDollarAndOperatorEquals$.inboundSchema = GetV2WebhooksDollarAndOperatorEquals$inboundSchema; /** @deprecated use `GetV2WebhooksDollarAndOperatorEquals$outboundSchema` instead. */ GetV2WebhooksDollarAndOperatorEquals$.outboundSchema = GetV2WebhooksDollarAndOperatorEquals$outboundSchema; })(GetV2WebhooksDollarAndOperatorEquals$ || (GetV2WebhooksDollarAndOperatorEquals$ = {})); /** @internal */ export const GetV2WebhooksDollarAndEquals$inboundSchema = z.object({ field: z.string(), operator: GetV2WebhooksDollarAndOperatorEquals$inboundSchema, value: z.string(), }); /** @internal */ export const GetV2WebhooksDollarAndEquals$outboundSchema = z.object({ field: z.string(), operator: GetV2WebhooksDollarAndOperatorEquals$outboundSchema, value: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarAndEquals$; (function (GetV2WebhooksDollarAndEquals$) { /** @deprecated use `GetV2WebhooksDollarAndEquals$inboundSchema` instead. */ GetV2WebhooksDollarAndEquals$.inboundSchema = GetV2WebhooksDollarAndEquals$inboundSchema; /** @deprecated use `GetV2WebhooksDollarAndEquals$outboundSchema` instead. */ GetV2WebhooksDollarAndEquals$.outboundSchema = GetV2WebhooksDollarAndEquals$outboundSchema; })(GetV2WebhooksDollarAndEquals$ || (GetV2WebhooksDollarAndEquals$ = {})); export function getV2WebhooksDollarAndEqualsToJSON(getV2WebhooksDollarAndEquals) { return JSON.stringify(GetV2WebhooksDollarAndEquals$outboundSchema.parse(getV2WebhooksDollarAndEquals)); } export function getV2WebhooksDollarAndEqualsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksDollarAndEquals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksDollarAndEquals' from JSON`); } /** @internal */ export const GetV2WebhooksDollarAndUnion$inboundSchema = z.union([ z.lazy(() => GetV2WebhooksDollarAndEquals$inboundSchema), z.lazy(() => GetV2WebhooksDollarAndNotEquals$inboundSchema), ]); /** @internal */ export const GetV2WebhooksDollarAndUnion$outboundSchema = z.union([ z.lazy(() => GetV2WebhooksDollarAndEquals$outboundSchema), z.lazy(() => GetV2WebhooksDollarAndNotEquals$outboundSchema), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarAndUnion$; (function (GetV2WebhooksDollarAndUnion$) { /** @deprecated use `GetV2WebhooksDollarAndUnion$inboundSchema` instead. */ GetV2WebhooksDollarAndUnion$.inboundSchema = GetV2WebhooksDollarAndUnion$inboundSchema; /** @deprecated use `GetV2WebhooksDollarAndUnion$outboundSchema` instead. */ GetV2WebhooksDollarAndUnion$.outboundSchema = GetV2WebhooksDollarAndUnion$outboundSchema; })(GetV2WebhooksDollarAndUnion$ || (GetV2WebhooksDollarAndUnion$ = {})); export function getV2WebhooksDollarAndUnionToJSON(getV2WebhooksDollarAndUnion) { return JSON.stringify(GetV2WebhooksDollarAndUnion$outboundSchema.parse(getV2WebhooksDollarAndUnion)); } export function getV2WebhooksDollarAndUnionFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksDollarAndUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksDollarAndUnion' from JSON`); } /** @internal */ export const GetV2WebhooksFilter2$inboundSchema = z.object({ $and: z.array(z.union([ z.lazy(() => GetV2WebhooksDollarAndEquals$inboundSchema), z.lazy(() => GetV2WebhooksDollarAndNotEquals$inboundSchema), ])), }).transform((v) => { return remap$(v, { "$and": "dollarAnd", }); }); /** @internal */ export const GetV2WebhooksFilter2$outboundSchema = z.object({ dollarAnd: z.array(z.union([ z.lazy(() => GetV2WebhooksDollarAndEquals$outboundSchema), z.lazy(() => GetV2WebhooksDollarAndNotEquals$outboundSchema), ])), }).transform((v) => { return remap$(v, { dollarAnd: "$and", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksFilter2$; (function (GetV2WebhooksFilter2$) { /** @deprecated use `GetV2WebhooksFilter2$inboundSchema` instead. */ GetV2WebhooksFilter2$.inboundSchema = GetV2WebhooksFilter2$inboundSchema; /** @deprecated use `GetV2WebhooksFilter2$outboundSchema` instead. */ GetV2WebhooksFilter2$.outboundSchema = GetV2WebhooksFilter2$outboundSchema; })(GetV2WebhooksFilter2$ || (GetV2WebhooksFilter2$ = {})); export function getV2WebhooksFilter2ToJSON(getV2WebhooksFilter2) { return JSON.stringify(GetV2WebhooksFilter2$outboundSchema.parse(getV2WebhooksFilter2)); } export function getV2WebhooksFilter2FromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksFilter2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksFilter2' from JSON`); } /** @internal */ export const GetV2WebhooksDollarOrOperatorNotEquals$inboundSchema = z.nativeEnum(GetV2WebhooksDollarOrOperatorNotEquals); /** @internal */ export const GetV2WebhooksDollarOrOperatorNotEquals$outboundSchema = GetV2WebhooksDollarOrOperatorNotEquals$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarOrOperatorNotEquals$; (function (GetV2WebhooksDollarOrOperatorNotEquals$) { /** @deprecated use `GetV2WebhooksDollarOrOperatorNotEquals$inboundSchema` instead. */ GetV2WebhooksDollarOrOperatorNotEquals$.inboundSchema = GetV2WebhooksDollarOrOperatorNotEquals$inboundSchema; /** @deprecated use `GetV2WebhooksDollarOrOperatorNotEquals$outboundSchema` instead. */ GetV2WebhooksDollarOrOperatorNotEquals$.outboundSchema = GetV2WebhooksDollarOrOperatorNotEquals$outboundSchema; })(GetV2WebhooksDollarOrOperatorNotEquals$ || (GetV2WebhooksDollarOrOperatorNotEquals$ = {})); /** @internal */ export const GetV2WebhooksDollarOrNotEquals$inboundSchema = z.object({ field: z.string(), operator: GetV2WebhooksDollarOrOperatorNotEquals$inboundSchema, value: z.string(), }); /** @internal */ export const GetV2WebhooksDollarOrNotEquals$outboundSchema = z.object({ field: z.string(), operator: GetV2WebhooksDollarOrOperatorNotEquals$outboundSchema, value: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarOrNotEquals$; (function (GetV2WebhooksDollarOrNotEquals$) { /** @deprecated use `GetV2WebhooksDollarOrNotEquals$inboundSchema` instead. */ GetV2WebhooksDollarOrNotEquals$.inboundSchema = GetV2WebhooksDollarOrNotEquals$inboundSchema; /** @deprecated use `GetV2WebhooksDollarOrNotEquals$outboundSchema` instead. */ GetV2WebhooksDollarOrNotEquals$.outboundSchema = GetV2WebhooksDollarOrNotEquals$outboundSchema; })(GetV2WebhooksDollarOrNotEquals$ || (GetV2WebhooksDollarOrNotEquals$ = {})); export function getV2WebhooksDollarOrNotEqualsToJSON(getV2WebhooksDollarOrNotEquals) { return JSON.stringify(GetV2WebhooksDollarOrNotEquals$outboundSchema.parse(getV2WebhooksDollarOrNotEquals)); } export function getV2WebhooksDollarOrNotEqualsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksDollarOrNotEquals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksDollarOrNotEquals' from JSON`); } /** @internal */ export const GetV2WebhooksDollarOrOperatorEquals$inboundSchema = z.nativeEnum(GetV2WebhooksDollarOrOperatorEquals); /** @internal */ export const GetV2WebhooksDollarOrOperatorEquals$outboundSchema = GetV2WebhooksDollarOrOperatorEquals$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarOrOperatorEquals$; (function (GetV2WebhooksDollarOrOperatorEquals$) { /** @deprecated use `GetV2WebhooksDollarOrOperatorEquals$inboundSchema` instead. */ GetV2WebhooksDollarOrOperatorEquals$.inboundSchema = GetV2WebhooksDollarOrOperatorEquals$inboundSchema; /** @deprecated use `GetV2WebhooksDollarOrOperatorEquals$outboundSchema` instead. */ GetV2WebhooksDollarOrOperatorEquals$.outboundSchema = GetV2WebhooksDollarOrOperatorEquals$outboundSchema; })(GetV2WebhooksDollarOrOperatorEquals$ || (GetV2WebhooksDollarOrOperatorEquals$ = {})); /** @internal */ export const GetV2WebhooksDollarOrEquals$inboundSchema = z.object({ field: z.string(), operator: GetV2WebhooksDollarOrOperatorEquals$inboundSchema, value: z.string(), }); /** @internal */ export const GetV2WebhooksDollarOrEquals$outboundSchema = z.object({ field: z.string(), operator: GetV2WebhooksDollarOrOperatorEquals$outboundSchema, value: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarOrEquals$; (function (GetV2WebhooksDollarOrEquals$) { /** @deprecated use `GetV2WebhooksDollarOrEquals$inboundSchema` instead. */ GetV2WebhooksDollarOrEquals$.inboundSchema = GetV2WebhooksDollarOrEquals$inboundSchema; /** @deprecated use `GetV2WebhooksDollarOrEquals$outboundSchema` instead. */ GetV2WebhooksDollarOrEquals$.outboundSchema = GetV2WebhooksDollarOrEquals$outboundSchema; })(GetV2WebhooksDollarOrEquals$ || (GetV2WebhooksDollarOrEquals$ = {})); export function getV2WebhooksDollarOrEqualsToJSON(getV2WebhooksDollarOrEquals) { return JSON.stringify(GetV2WebhooksDollarOrEquals$outboundSchema.parse(getV2WebhooksDollarOrEquals)); } export function getV2WebhooksDollarOrEqualsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksDollarOrEquals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksDollarOrEquals' from JSON`); } /** @internal */ export const GetV2WebhooksDollarOrUnion$inboundSchema = z.union([ z.lazy(() => GetV2WebhooksDollarOrEquals$inboundSchema), z.lazy(() => GetV2WebhooksDollarOrNotEquals$inboundSchema), ]); /** @internal */ export const GetV2WebhooksDollarOrUnion$outboundSchema = z.union([ z.lazy(() => GetV2WebhooksDollarOrEquals$outboundSchema), z.lazy(() => GetV2WebhooksDollarOrNotEquals$outboundSchema), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksDollarOrUnion$; (function (GetV2WebhooksDollarOrUnion$) { /** @deprecated use `GetV2WebhooksDollarOrUnion$inboundSchema` instead. */ GetV2WebhooksDollarOrUnion$.inboundSchema = GetV2WebhooksDollarOrUnion$inboundSchema; /** @deprecated use `GetV2WebhooksDollarOrUnion$outboundSchema` instead. */ GetV2WebhooksDollarOrUnion$.outboundSchema = GetV2WebhooksDollarOrUnion$outboundSchema; })(GetV2WebhooksDollarOrUnion$ || (GetV2WebhooksDollarOrUnion$ = {})); export function getV2WebhooksDollarOrUnionToJSON(getV2WebhooksDollarOrUnion) { return JSON.stringify(GetV2WebhooksDollarOrUnion$outboundSchema.parse(getV2WebhooksDollarOrUnion)); } export function getV2WebhooksDollarOrUnionFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksDollarOrUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksDollarOrUnion' from JSON`); } /** @internal */ export const GetV2WebhooksFilter1$inboundSchema = z.object({ $or: z.array(z.union([ z.lazy(() => GetV2WebhooksDollarOrEquals$inboundSchema), z.lazy(() => GetV2WebhooksDollarOrNotEquals$inboundSchema), ])), }).transform((v) => { return remap$(v, { "$or": "dollarOr", }); }); /** @internal */ export const GetV2WebhooksFilter1$outboundSchema = z.object({ dollarOr: z.array(z.union([ z.lazy(() => GetV2WebhooksDollarOrEquals$outboundSchema), z.lazy(() => GetV2WebhooksDollarOrNotEquals$outboundSchema), ])), }).transform((v) => { return remap$(v, { dollarOr: "$or", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksFilter1$; (function (GetV2WebhooksFilter1$) { /** @deprecated use `GetV2WebhooksFilter1$inboundSchema` instead. */ GetV2WebhooksFilter1$.inboundSchema = GetV2WebhooksFilter1$inboundSchema; /** @deprecated use `GetV2WebhooksFilter1$outboundSchema` instead. */ GetV2WebhooksFilter1$.outboundSchema = GetV2WebhooksFilter1$outboundSchema; })(GetV2WebhooksFilter1$ || (GetV2WebhooksFilter1$ = {})); export function getV2WebhooksFilter1ToJSON(getV2WebhooksFilter1) { return JSON.stringify(GetV2WebhooksFilter1$outboundSchema.parse(getV2WebhooksFilter1)); } export function getV2WebhooksFilter1FromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksFilter1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksFilter1' from JSON`); } /** @internal */ export const GetV2WebhooksFilterUnion$inboundSchema = z.union([ z.lazy(() => GetV2WebhooksFilter1$inboundSchema), z.lazy(() => GetV2WebhooksFilter2$inboundSchema), ]); /** @internal */ export const GetV2WebhooksFilterUnion$outboundSchema = z.union([ z.lazy(() => GetV2WebhooksFilter1$outboundSchema), z.lazy(() => GetV2WebhooksFilter2$outboundSchema), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksFilterUnion$; (function (GetV2WebhooksFilterUnion$) { /** @deprecated use `GetV2WebhooksFilterUnion$inboundSchema` instead. */ GetV2WebhooksFilterUnion$.inboundSchema = GetV2WebhooksFilterUnion$inboundSchema; /** @deprecated use `GetV2WebhooksFilterUnion$outboundSchema` instead. */ GetV2WebhooksFilterUnion$.outboundSchema = GetV2WebhooksFilterUnion$outboundSchema; })(GetV2WebhooksFilterUnion$ || (GetV2WebhooksFilterUnion$ = {})); export function getV2WebhooksFilterUnionToJSON(getV2WebhooksFilterUnion) { return JSON.stringify(GetV2WebhooksFilterUnion$outboundSchema.parse(getV2WebhooksFilterUnion)); } export function getV2WebhooksFilterUnionFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksFilterUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksFilterUnion' from JSON`); } /** @internal */ export const GetV2WebhooksSubscription$inboundSchema = z.object({ event_type: GetV2WebhooksEventType$inboundSchema, filter: z.nullable(z.union([ z.lazy(() => GetV2WebhooksFilter1$inboundSchema), z.lazy(() => GetV2WebhooksFilter2$inboundSchema), ])), }).transform((v) => { return remap$(v, { "event_type": "eventType", }); }); /** @internal */ export const GetV2WebhooksSubscription$outboundSchema = z.object({ eventType: GetV2WebhooksEventType$outboundSchema, filter: z.nullable(z.union([ z.lazy(() => GetV2WebhooksFilter1$outboundSchema), z.lazy(() => GetV2WebhooksFilter2$outboundSchema), ])), }).transform((v) => { return remap$(v, { eventType: "event_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksSubscription$; (function (GetV2WebhooksSubscription$) { /** @deprecated use `GetV2WebhooksSubscription$inboundSchema` instead. */ GetV2WebhooksSubscription$.inboundSchema = GetV2WebhooksSubscription$inboundSchema; /** @deprecated use `GetV2WebhooksSubscription$outboundSchema` instead. */ GetV2WebhooksSubscription$.outboundSchema = GetV2WebhooksSubscription$outboundSchema; })(GetV2WebhooksSubscription$ || (GetV2WebhooksSubscription$ = {})); export function getV2WebhooksSubscriptionToJSON(getV2WebhooksSubscription) { return JSON.stringify(GetV2WebhooksSubscription$outboundSchema.parse(getV2WebhooksSubscription)); } export function getV2WebhooksSubscriptionFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksSubscription$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksSubscription' from JSON`); } /** @internal */ export const GetV2WebhooksId$inboundSchema = z.object({ workspace_id: z.string(), webhook_id: z.string(), }).transform((v) => { return remap$(v, { "workspace_id": "workspaceId", "webhook_id": "webhookId", }); }); /** @internal */ export const GetV2WebhooksId$outboundSchema = z.object({ workspaceId: z.string(), webhookId: z.string(), }).transform((v) => { return remap$(v, { workspaceId: "workspace_id", webhookId: "webhook_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksId$; (function (GetV2WebhooksId$) { /** @deprecated use `GetV2WebhooksId$inboundSchema` instead. */ GetV2WebhooksId$.inboundSchema = GetV2WebhooksId$inboundSchema; /** @deprecated use `GetV2WebhooksId$outboundSchema` instead. */ GetV2WebhooksId$.outboundSchema = GetV2WebhooksId$outboundSchema; })(GetV2WebhooksId$ || (GetV2WebhooksId$ = {})); export function getV2WebhooksIdToJSON(getV2WebhooksId) { return JSON.stringify(GetV2WebhooksId$outboundSchema.parse(getV2WebhooksId)); } export function getV2WebhooksIdFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksId' from JSON`); } /** @internal */ export const GetV2WebhooksStatus$inboundSchema = z.nativeEnum(GetV2WebhooksStatus); /** @internal */ export const GetV2WebhooksStatus$outboundSchema = GetV2WebhooksStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksStatus$; (function (GetV2WebhooksStatus$) { /** @deprecated use `GetV2WebhooksStatus$inboundSchema` instead. */ GetV2WebhooksStatus$.inboundSchema = GetV2WebhooksStatus$inboundSchema; /** @deprecated use `GetV2WebhooksStatus$outboundSchema` instead. */ GetV2WebhooksStatus$.outboundSchema = GetV2WebhooksStatus$outboundSchema; })(GetV2WebhooksStatus$ || (GetV2WebhooksStatus$ = {})); /** @internal */ export const GetV2WebhooksData$inboundSchema = z.object({ target_url: z.string(), subscriptions: z.array(z.lazy(() => GetV2WebhooksSubscription$inboundSchema)), id: z.lazy(() => GetV2WebhooksId$inboundSchema), status: GetV2WebhooksStatus$inboundSchema, created_at: z.string(), }).transform((v) => { return remap$(v, { "target_url": "targetUrl", "created_at": "createdAt", }); }); /** @internal */ export const GetV2WebhooksData$outboundSchema = z.object({ targetUrl: z.string(), subscriptions: z.array(z.lazy(() => GetV2WebhooksSubscription$outboundSchema)), id: z.lazy(() => GetV2WebhooksId$outboundSchema), status: GetV2WebhooksStatus$outboundSchema, createdAt: z.string(), }).transform((v) => { return remap$(v, { targetUrl: "target_url", createdAt: "created_at", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksData$; (function (GetV2WebhooksData$) { /** @deprecated use `GetV2WebhooksData$inboundSchema` instead. */ GetV2WebhooksData$.inboundSchema = GetV2WebhooksData$inboundSchema; /** @deprecated use `GetV2WebhooksData$outboundSchema` instead. */ GetV2WebhooksData$.outboundSchema = GetV2WebhooksData$outboundSchema; })(GetV2WebhooksData$ || (GetV2WebhooksData$ = {})); export function getV2WebhooksDataToJSON(getV2WebhooksData) { return JSON.stringify(GetV2WebhooksData$outboundSchema.parse(getV2WebhooksData)); } export function getV2WebhooksDataFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksData' from JSON`); } /** @internal */ export const GetV2WebhooksResponse$inboundSchema = z.object({ data: z.array(z.lazy(() => GetV2WebhooksData$inboundSchema)), }); /** @internal */ export const GetV2WebhooksResponse$outboundSchema = z.object({ data: z.array(z.lazy(() => GetV2WebhooksData$outboundSchema)), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2WebhooksResponse$; (function (GetV2WebhooksResponse$) { /** @deprecated use `GetV2WebhooksResponse$inboundSchema` instead. */ GetV2WebhooksResponse$.inboundSchema = GetV2WebhooksResponse$inboundSchema; /** @deprecated use `GetV2WebhooksResponse$outboundSchema` instead. */ GetV2WebhooksResponse$.outboundSchema = GetV2WebhooksResponse$outboundSchema; })(GetV2WebhooksResponse$ || (GetV2WebhooksResponse$ = {})); export function getV2WebhooksResponseToJSON(getV2WebhooksResponse) { return JSON.stringify(GetV2WebhooksResponse$outboundSchema.parse(getV2WebhooksResponse)); } export function getV2WebhooksResponseFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2WebhooksResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2WebhooksResponse' from JSON`); } //# sourceMappingURL=getv2webhooks.js.map