UNPKG

attio-js

Version:

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

1,462 lines (1,329 loc) 89.4 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Type of event the webhook is subscribed to. */ export const PatchV2WebhooksWebhookIdEventTypeRequest = { 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", } as const; /** * Type of event the webhook is subscribed to. */ export type PatchV2WebhooksWebhookIdEventTypeRequest = ClosedEnum< typeof PatchV2WebhooksWebhookIdEventTypeRequest >; export const PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest = { NotEquals: "not_equals", } as const; export type PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest = ClosedEnum<typeof PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest>; export type PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest = { field: string; operator: PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest; value: string; }; export const PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest = { Equals: "equals", } as const; export type PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest = ClosedEnum< typeof PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest >; export type PatchV2WebhooksWebhookIdDollarAndEqualsRequest = { field: string; operator: PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest; value: string; }; export type PatchV2WebhooksWebhookIdDollarAndRequestUnion = | PatchV2WebhooksWebhookIdDollarAndEqualsRequest | PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest; export type PatchV2WebhooksWebhookIdFilterRequest2 = { dollarAnd: Array< | PatchV2WebhooksWebhookIdDollarAndEqualsRequest | PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest >; }; export const PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest = { NotEquals: "not_equals", } as const; export type PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest = ClosedEnum<typeof PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest>; export type PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest = { field: string; operator: PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest; value: string; }; export const PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest = { Equals: "equals", } as const; export type PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest = ClosedEnum< typeof PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest >; export type PatchV2WebhooksWebhookIdDollarOrEqualsRequest = { field: string; operator: PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest; value: string; }; export type PatchV2WebhooksWebhookIdDollarOrRequestUnion = | PatchV2WebhooksWebhookIdDollarOrEqualsRequest | PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest; export type PatchV2WebhooksWebhookIdFilterRequest1 = { dollarOr: Array< | PatchV2WebhooksWebhookIdDollarOrEqualsRequest | PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest >; }; /** * Filters to determine whether the webhook event should be sent. If null, the filter always passes. */ export type PatchV2WebhooksWebhookIdFilterRequestUnion = | PatchV2WebhooksWebhookIdFilterRequest1 | PatchV2WebhooksWebhookIdFilterRequest2; export type PatchV2WebhooksWebhookIdSubscriptionRequest = { /** * Type of event the webhook is subscribed to. */ eventType: PatchV2WebhooksWebhookIdEventTypeRequest; /** * Filters to determine whether the webhook event should be sent. If null, the filter always passes. */ filter: | PatchV2WebhooksWebhookIdFilterRequest1 | PatchV2WebhooksWebhookIdFilterRequest2 | null; }; export type PatchV2WebhooksWebhookIdDataRequest = { /** * URL where the webhook events will be delivered to. */ targetUrl?: string | undefined; /** * One or more events the webhook is subscribed to. */ subscriptions?: | Array<PatchV2WebhooksWebhookIdSubscriptionRequest> | undefined; }; export type PatchV2WebhooksWebhookIdRequestBody = { data: PatchV2WebhooksWebhookIdDataRequest; }; export type PatchV2WebhooksWebhookIdRequest = { webhookId: string; requestBody: PatchV2WebhooksWebhookIdRequestBody; }; /** * Type of event the webhook is subscribed to. */ export const PatchV2WebhooksWebhookIdEventTypeResponse = { 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", } as const; /** * Type of event the webhook is subscribed to. */ export type PatchV2WebhooksWebhookIdEventTypeResponse = ClosedEnum< typeof PatchV2WebhooksWebhookIdEventTypeResponse >; export const PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsResponse = { NotEquals: "not_equals", } as const; export type PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsResponse = ClosedEnum<typeof PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsResponse>; export type PatchV2WebhooksWebhookIdDollarAndNotEqualsResponse = { field: string; operator: PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsResponse; value: string; }; export const PatchV2WebhooksWebhookIdDollarAndOperatorEqualsResponse = { Equals: "equals", } as const; export type PatchV2WebhooksWebhookIdDollarAndOperatorEqualsResponse = ClosedEnum<typeof PatchV2WebhooksWebhookIdDollarAndOperatorEqualsResponse>; export type PatchV2WebhooksWebhookIdDollarAndEqualsResponse = { field: string; operator: PatchV2WebhooksWebhookIdDollarAndOperatorEqualsResponse; value: string; }; export type PatchV2WebhooksWebhookIdDollarAndResponseUnion = | PatchV2WebhooksWebhookIdDollarAndEqualsResponse | PatchV2WebhooksWebhookIdDollarAndNotEqualsResponse; export type PatchV2WebhooksWebhookIdFilterResponse2 = { dollarAnd: Array< | PatchV2WebhooksWebhookIdDollarAndEqualsResponse | PatchV2WebhooksWebhookIdDollarAndNotEqualsResponse >; }; export const PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsResponse = { NotEquals: "not_equals", } as const; export type PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsResponse = ClosedEnum<typeof PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsResponse>; export type PatchV2WebhooksWebhookIdDollarOrNotEqualsResponse = { field: string; operator: PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsResponse; value: string; }; export const PatchV2WebhooksWebhookIdDollarOrOperatorEqualsResponse = { Equals: "equals", } as const; export type PatchV2WebhooksWebhookIdDollarOrOperatorEqualsResponse = ClosedEnum< typeof PatchV2WebhooksWebhookIdDollarOrOperatorEqualsResponse >; export type PatchV2WebhooksWebhookIdDollarOrEqualsResponse = { field: string; operator: PatchV2WebhooksWebhookIdDollarOrOperatorEqualsResponse; value: string; }; export type PatchV2WebhooksWebhookIdDollarOrResponseUnion = | PatchV2WebhooksWebhookIdDollarOrEqualsResponse | PatchV2WebhooksWebhookIdDollarOrNotEqualsResponse; export type PatchV2WebhooksWebhookIdFilterResponse1 = { dollarOr: Array< | PatchV2WebhooksWebhookIdDollarOrEqualsResponse | PatchV2WebhooksWebhookIdDollarOrNotEqualsResponse >; }; /** * Filters to determine whether the webhook event should be sent. If null, the filter always passes. */ export type PatchV2WebhooksWebhookIdFilterResponseUnion = | PatchV2WebhooksWebhookIdFilterResponse1 | PatchV2WebhooksWebhookIdFilterResponse2; export type PatchV2WebhooksWebhookIdSubscriptionResponse = { /** * Type of event the webhook is subscribed to. */ eventType: PatchV2WebhooksWebhookIdEventTypeResponse; /** * Filters to determine whether the webhook event should be sent. If null, the filter always passes. */ filter: | PatchV2WebhooksWebhookIdFilterResponse1 | PatchV2WebhooksWebhookIdFilterResponse2 | null; }; export type PatchV2WebhooksWebhookIdId = { /** * The ID of the workspace the webhook belongs to. */ workspaceId: string; /** * The ID of the webhook. */ webhookId: string; }; /** * 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 PatchV2WebhooksWebhookIdStatus = { Active: "active", Degraded: "degraded", Inactive: "inactive", } as const; /** * 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 type PatchV2WebhooksWebhookIdStatus = ClosedEnum< typeof PatchV2WebhooksWebhookIdStatus >; export type PatchV2WebhooksWebhookIdDataResponse = { /** * URL where the webhook events will be delivered to. */ targetUrl: string; /** * One or more events the webhook is subscribed to. */ subscriptions: Array<PatchV2WebhooksWebhookIdSubscriptionResponse>; id: PatchV2WebhooksWebhookIdId; /** * 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. */ status: PatchV2WebhooksWebhookIdStatus; /** * When the webhook was created. */ createdAt: string; }; /** * Success */ export type PatchV2WebhooksWebhookIdResponse = { data: PatchV2WebhooksWebhookIdDataResponse; }; /** @internal */ export const PatchV2WebhooksWebhookIdEventTypeRequest$inboundSchema: z.ZodNativeEnum<typeof PatchV2WebhooksWebhookIdEventTypeRequest> = z .nativeEnum(PatchV2WebhooksWebhookIdEventTypeRequest); /** @internal */ export const PatchV2WebhooksWebhookIdEventTypeRequest$outboundSchema: z.ZodNativeEnum<typeof PatchV2WebhooksWebhookIdEventTypeRequest> = PatchV2WebhooksWebhookIdEventTypeRequest$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdEventTypeRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdEventTypeRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdEventTypeRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdEventTypeRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdEventTypeRequest$outboundSchema; } /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$inboundSchema: z.ZodNativeEnum< typeof PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest > = z.nativeEnum(PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest); /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$outboundSchema: z.ZodNativeEnum< typeof PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest > = PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$outboundSchema; } /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest, z.ZodTypeDef, unknown > = z.object({ field: z.string(), operator: PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$inboundSchema, value: z.string(), }); /** @internal */ export type PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$Outbound = { field: string; operator: string; value: string; }; /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest > = z.object({ field: z.string(), operator: PatchV2WebhooksWebhookIdDollarAndOperatorNotEqualsRequest$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 namespace PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$Outbound; } export function patchV2WebhooksWebhookIdDollarAndNotEqualsRequestToJSON( patchV2WebhooksWebhookIdDollarAndNotEqualsRequest: PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$outboundSchema.parse( patchV2WebhooksWebhookIdDollarAndNotEqualsRequest, ), ); } export function patchV2WebhooksWebhookIdDollarAndNotEqualsRequestFromJSON( jsonString: string, ): SafeParseResult< PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$inboundSchema: z.ZodNativeEnum< typeof PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest > = z.nativeEnum(PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest); /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$outboundSchema: z.ZodNativeEnum< typeof PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest > = PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$outboundSchema; } /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndEqualsRequest$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarAndEqualsRequest, z.ZodTypeDef, unknown > = z.object({ field: z.string(), operator: PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$inboundSchema, value: z.string(), }); /** @internal */ export type PatchV2WebhooksWebhookIdDollarAndEqualsRequest$Outbound = { field: string; operator: string; value: string; }; /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndEqualsRequest$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarAndEqualsRequest$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdDollarAndEqualsRequest > = z.object({ field: z.string(), operator: PatchV2WebhooksWebhookIdDollarAndOperatorEqualsRequest$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 namespace PatchV2WebhooksWebhookIdDollarAndEqualsRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndEqualsRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarAndEqualsRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndEqualsRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarAndEqualsRequest$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndEqualsRequest$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdDollarAndEqualsRequest$Outbound; } export function patchV2WebhooksWebhookIdDollarAndEqualsRequestToJSON( patchV2WebhooksWebhookIdDollarAndEqualsRequest: PatchV2WebhooksWebhookIdDollarAndEqualsRequest, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdDollarAndEqualsRequest$outboundSchema.parse( patchV2WebhooksWebhookIdDollarAndEqualsRequest, ), ); } export function patchV2WebhooksWebhookIdDollarAndEqualsRequestFromJSON( jsonString: string, ): SafeParseResult< PatchV2WebhooksWebhookIdDollarAndEqualsRequest, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdDollarAndEqualsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2WebhooksWebhookIdDollarAndEqualsRequest' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndRequestUnion$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarAndRequestUnion, z.ZodTypeDef, unknown > = z.union([ z.lazy(() => PatchV2WebhooksWebhookIdDollarAndEqualsRequest$inboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$inboundSchema ), ]); /** @internal */ export type PatchV2WebhooksWebhookIdDollarAndRequestUnion$Outbound = | PatchV2WebhooksWebhookIdDollarAndEqualsRequest$Outbound | PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$Outbound; /** @internal */ export const PatchV2WebhooksWebhookIdDollarAndRequestUnion$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarAndRequestUnion$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdDollarAndRequestUnion > = z.union([ z.lazy(() => PatchV2WebhooksWebhookIdDollarAndEqualsRequest$outboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$outboundSchema ), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdDollarAndRequestUnion$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndRequestUnion$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarAndRequestUnion$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndRequestUnion$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarAndRequestUnion$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarAndRequestUnion$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdDollarAndRequestUnion$Outbound; } export function patchV2WebhooksWebhookIdDollarAndRequestUnionToJSON( patchV2WebhooksWebhookIdDollarAndRequestUnion: PatchV2WebhooksWebhookIdDollarAndRequestUnion, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdDollarAndRequestUnion$outboundSchema.parse( patchV2WebhooksWebhookIdDollarAndRequestUnion, ), ); } export function patchV2WebhooksWebhookIdDollarAndRequestUnionFromJSON( jsonString: string, ): SafeParseResult< PatchV2WebhooksWebhookIdDollarAndRequestUnion, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdDollarAndRequestUnion$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2WebhooksWebhookIdDollarAndRequestUnion' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdFilterRequest2$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdFilterRequest2, z.ZodTypeDef, unknown > = z.object({ $and: z.array( z.union([ z.lazy(() => PatchV2WebhooksWebhookIdDollarAndEqualsRequest$inboundSchema ), z.lazy(() => PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$inboundSchema ), ]), ), }).transform((v) => { return remap$(v, { "$and": "dollarAnd", }); }); /** @internal */ export type PatchV2WebhooksWebhookIdFilterRequest2$Outbound = { $and: Array< | PatchV2WebhooksWebhookIdDollarAndEqualsRequest$Outbound | PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$Outbound >; }; /** @internal */ export const PatchV2WebhooksWebhookIdFilterRequest2$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdFilterRequest2$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdFilterRequest2 > = z.object({ dollarAnd: z.array( z.union([ z.lazy(() => PatchV2WebhooksWebhookIdDollarAndEqualsRequest$outboundSchema ), z.lazy(() => PatchV2WebhooksWebhookIdDollarAndNotEqualsRequest$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 namespace PatchV2WebhooksWebhookIdFilterRequest2$ { /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequest2$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdFilterRequest2$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequest2$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdFilterRequest2$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequest2$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdFilterRequest2$Outbound; } export function patchV2WebhooksWebhookIdFilterRequest2ToJSON( patchV2WebhooksWebhookIdFilterRequest2: PatchV2WebhooksWebhookIdFilterRequest2, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdFilterRequest2$outboundSchema.parse( patchV2WebhooksWebhookIdFilterRequest2, ), ); } export function patchV2WebhooksWebhookIdFilterRequest2FromJSON( jsonString: string, ): SafeParseResult<PatchV2WebhooksWebhookIdFilterRequest2, SDKValidationError> { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdFilterRequest2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchV2WebhooksWebhookIdFilterRequest2' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$inboundSchema: z.ZodNativeEnum< typeof PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest > = z.nativeEnum(PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest); /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$outboundSchema: z.ZodNativeEnum< typeof PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest > = PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$outboundSchema; } /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest, z.ZodTypeDef, unknown > = z.object({ field: z.string(), operator: PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$inboundSchema, value: z.string(), }); /** @internal */ export type PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$Outbound = { field: string; operator: string; value: string; }; /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest > = z.object({ field: z.string(), operator: PatchV2WebhooksWebhookIdDollarOrOperatorNotEqualsRequest$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 namespace PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$Outbound; } export function patchV2WebhooksWebhookIdDollarOrNotEqualsRequestToJSON( patchV2WebhooksWebhookIdDollarOrNotEqualsRequest: PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$outboundSchema.parse( patchV2WebhooksWebhookIdDollarOrNotEqualsRequest, ), ); } export function patchV2WebhooksWebhookIdDollarOrNotEqualsRequestFromJSON( jsonString: string, ): SafeParseResult< PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$inboundSchema: z.ZodNativeEnum< typeof PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest > = z.nativeEnum(PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest); /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$outboundSchema: z.ZodNativeEnum< typeof PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest > = PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$outboundSchema; } /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrEqualsRequest$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarOrEqualsRequest, z.ZodTypeDef, unknown > = z.object({ field: z.string(), operator: PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$inboundSchema, value: z.string(), }); /** @internal */ export type PatchV2WebhooksWebhookIdDollarOrEqualsRequest$Outbound = { field: string; operator: string; value: string; }; /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrEqualsRequest$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarOrEqualsRequest$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdDollarOrEqualsRequest > = z.object({ field: z.string(), operator: PatchV2WebhooksWebhookIdDollarOrOperatorEqualsRequest$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 namespace PatchV2WebhooksWebhookIdDollarOrEqualsRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrEqualsRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarOrEqualsRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrEqualsRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarOrEqualsRequest$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrEqualsRequest$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdDollarOrEqualsRequest$Outbound; } export function patchV2WebhooksWebhookIdDollarOrEqualsRequestToJSON( patchV2WebhooksWebhookIdDollarOrEqualsRequest: PatchV2WebhooksWebhookIdDollarOrEqualsRequest, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdDollarOrEqualsRequest$outboundSchema.parse( patchV2WebhooksWebhookIdDollarOrEqualsRequest, ), ); } export function patchV2WebhooksWebhookIdDollarOrEqualsRequestFromJSON( jsonString: string, ): SafeParseResult< PatchV2WebhooksWebhookIdDollarOrEqualsRequest, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdDollarOrEqualsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2WebhooksWebhookIdDollarOrEqualsRequest' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrRequestUnion$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarOrRequestUnion, z.ZodTypeDef, unknown > = z.union([ z.lazy(() => PatchV2WebhooksWebhookIdDollarOrEqualsRequest$inboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$inboundSchema ), ]); /** @internal */ export type PatchV2WebhooksWebhookIdDollarOrRequestUnion$Outbound = | PatchV2WebhooksWebhookIdDollarOrEqualsRequest$Outbound | PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$Outbound; /** @internal */ export const PatchV2WebhooksWebhookIdDollarOrRequestUnion$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDollarOrRequestUnion$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdDollarOrRequestUnion > = z.union([ z.lazy(() => PatchV2WebhooksWebhookIdDollarOrEqualsRequest$outboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$outboundSchema ), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdDollarOrRequestUnion$ { /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrRequestUnion$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDollarOrRequestUnion$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrRequestUnion$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDollarOrRequestUnion$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDollarOrRequestUnion$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdDollarOrRequestUnion$Outbound; } export function patchV2WebhooksWebhookIdDollarOrRequestUnionToJSON( patchV2WebhooksWebhookIdDollarOrRequestUnion: PatchV2WebhooksWebhookIdDollarOrRequestUnion, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdDollarOrRequestUnion$outboundSchema.parse( patchV2WebhooksWebhookIdDollarOrRequestUnion, ), ); } export function patchV2WebhooksWebhookIdDollarOrRequestUnionFromJSON( jsonString: string, ): SafeParseResult< PatchV2WebhooksWebhookIdDollarOrRequestUnion, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdDollarOrRequestUnion$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2WebhooksWebhookIdDollarOrRequestUnion' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdFilterRequest1$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdFilterRequest1, z.ZodTypeDef, unknown > = z.object({ $or: z.array( z.union([ z.lazy(() => PatchV2WebhooksWebhookIdDollarOrEqualsRequest$inboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$inboundSchema ), ]), ), }).transform((v) => { return remap$(v, { "$or": "dollarOr", }); }); /** @internal */ export type PatchV2WebhooksWebhookIdFilterRequest1$Outbound = { $or: Array< | PatchV2WebhooksWebhookIdDollarOrEqualsRequest$Outbound | PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$Outbound >; }; /** @internal */ export const PatchV2WebhooksWebhookIdFilterRequest1$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdFilterRequest1$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdFilterRequest1 > = z.object({ dollarOr: z.array( z.union([ z.lazy(() => PatchV2WebhooksWebhookIdDollarOrEqualsRequest$outboundSchema ), z.lazy(() => PatchV2WebhooksWebhookIdDollarOrNotEqualsRequest$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 namespace PatchV2WebhooksWebhookIdFilterRequest1$ { /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequest1$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdFilterRequest1$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequest1$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdFilterRequest1$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequest1$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdFilterRequest1$Outbound; } export function patchV2WebhooksWebhookIdFilterRequest1ToJSON( patchV2WebhooksWebhookIdFilterRequest1: PatchV2WebhooksWebhookIdFilterRequest1, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdFilterRequest1$outboundSchema.parse( patchV2WebhooksWebhookIdFilterRequest1, ), ); } export function patchV2WebhooksWebhookIdFilterRequest1FromJSON( jsonString: string, ): SafeParseResult<PatchV2WebhooksWebhookIdFilterRequest1, SDKValidationError> { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdFilterRequest1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchV2WebhooksWebhookIdFilterRequest1' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdFilterRequestUnion$inboundSchema: z.ZodType<PatchV2WebhooksWebhookIdFilterRequestUnion, z.ZodTypeDef, unknown> = z.union([ z.lazy(() => PatchV2WebhooksWebhookIdFilterRequest1$inboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdFilterRequest2$inboundSchema), ]); /** @internal */ export type PatchV2WebhooksWebhookIdFilterRequestUnion$Outbound = | PatchV2WebhooksWebhookIdFilterRequest1$Outbound | PatchV2WebhooksWebhookIdFilterRequest2$Outbound; /** @internal */ export const PatchV2WebhooksWebhookIdFilterRequestUnion$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdFilterRequestUnion$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdFilterRequestUnion > = z.union([ z.lazy(() => PatchV2WebhooksWebhookIdFilterRequest1$outboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdFilterRequest2$outboundSchema), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdFilterRequestUnion$ { /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequestUnion$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdFilterRequestUnion$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequestUnion$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdFilterRequestUnion$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdFilterRequestUnion$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdFilterRequestUnion$Outbound; } export function patchV2WebhooksWebhookIdFilterRequestUnionToJSON( patchV2WebhooksWebhookIdFilterRequestUnion: PatchV2WebhooksWebhookIdFilterRequestUnion, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdFilterRequestUnion$outboundSchema.parse( patchV2WebhooksWebhookIdFilterRequestUnion, ), ); } export function patchV2WebhooksWebhookIdFilterRequestUnionFromJSON( jsonString: string, ): SafeParseResult< PatchV2WebhooksWebhookIdFilterRequestUnion, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdFilterRequestUnion$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2WebhooksWebhookIdFilterRequestUnion' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdSubscriptionRequest$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdSubscriptionRequest, z.ZodTypeDef, unknown > = z.object({ event_type: PatchV2WebhooksWebhookIdEventTypeRequest$inboundSchema, filter: z.nullable( z.union([ z.lazy(() => PatchV2WebhooksWebhookIdFilterRequest1$inboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdFilterRequest2$inboundSchema), ]), ), }).transform((v) => { return remap$(v, { "event_type": "eventType", }); }); /** @internal */ export type PatchV2WebhooksWebhookIdSubscriptionRequest$Outbound = { event_type: string; filter: | PatchV2WebhooksWebhookIdFilterRequest1$Outbound | PatchV2WebhooksWebhookIdFilterRequest2$Outbound | null; }; /** @internal */ export const PatchV2WebhooksWebhookIdSubscriptionRequest$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdSubscriptionRequest$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdSubscriptionRequest > = z.object({ eventType: PatchV2WebhooksWebhookIdEventTypeRequest$outboundSchema, filter: z.nullable( z.union([ z.lazy(() => PatchV2WebhooksWebhookIdFilterRequest1$outboundSchema), z.lazy(() => PatchV2WebhooksWebhookIdFilterRequest2$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 namespace PatchV2WebhooksWebhookIdSubscriptionRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdSubscriptionRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdSubscriptionRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdSubscriptionRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdSubscriptionRequest$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdSubscriptionRequest$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdSubscriptionRequest$Outbound; } export function patchV2WebhooksWebhookIdSubscriptionRequestToJSON( patchV2WebhooksWebhookIdSubscriptionRequest: PatchV2WebhooksWebhookIdSubscriptionRequest, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdSubscriptionRequest$outboundSchema.parse( patchV2WebhooksWebhookIdSubscriptionRequest, ), ); } export function patchV2WebhooksWebhookIdSubscriptionRequestFromJSON( jsonString: string, ): SafeParseResult< PatchV2WebhooksWebhookIdSubscriptionRequest, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdSubscriptionRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2WebhooksWebhookIdSubscriptionRequest' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdDataRequest$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDataRequest, z.ZodTypeDef, unknown > = z.object({ target_url: z.string().optional(), subscriptions: z.array( z.lazy(() => PatchV2WebhooksWebhookIdSubscriptionRequest$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "target_url": "targetUrl", }); }); /** @internal */ export type PatchV2WebhooksWebhookIdDataRequest$Outbound = { target_url?: string | undefined; subscriptions?: | Array<PatchV2WebhooksWebhookIdSubscriptionRequest$Outbound> | undefined; }; /** @internal */ export const PatchV2WebhooksWebhookIdDataRequest$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdDataRequest$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdDataRequest > = z.object({ targetUrl: z.string().optional(), subscriptions: z.array( z.lazy(() => PatchV2WebhooksWebhookIdSubscriptionRequest$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { targetUrl: "target_url", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdDataRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdDataRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdDataRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDataRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdDataRequest$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdDataRequest$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdDataRequest$Outbound; } export function patchV2WebhooksWebhookIdDataRequestToJSON( patchV2WebhooksWebhookIdDataRequest: PatchV2WebhooksWebhookIdDataRequest, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdDataRequest$outboundSchema.parse( patchV2WebhooksWebhookIdDataRequest, ), ); } export function patchV2WebhooksWebhookIdDataRequestFromJSON( jsonString: string, ): SafeParseResult<PatchV2WebhooksWebhookIdDataRequest, SDKValidationError> { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdDataRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchV2WebhooksWebhookIdDataRequest' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdRequestBody$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdRequestBody, z.ZodTypeDef, unknown > = z.object({ data: z.lazy(() => PatchV2WebhooksWebhookIdDataRequest$inboundSchema), }); /** @internal */ export type PatchV2WebhooksWebhookIdRequestBody$Outbound = { data: PatchV2WebhooksWebhookIdDataRequest$Outbound; }; /** @internal */ export const PatchV2WebhooksWebhookIdRequestBody$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdRequestBody$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdRequestBody > = z.object({ data: z.lazy(() => PatchV2WebhooksWebhookIdDataRequest$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2WebhooksWebhookIdRequestBody$ { /** @deprecated use `PatchV2WebhooksWebhookIdRequestBody$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdRequestBody$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdRequestBody$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdRequestBody$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdRequestBody$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdRequestBody$Outbound; } export function patchV2WebhooksWebhookIdRequestBodyToJSON( patchV2WebhooksWebhookIdRequestBody: PatchV2WebhooksWebhookIdRequestBody, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdRequestBody$outboundSchema.parse( patchV2WebhooksWebhookIdRequestBody, ), ); } export function patchV2WebhooksWebhookIdRequestBodyFromJSON( jsonString: string, ): SafeParseResult<PatchV2WebhooksWebhookIdRequestBody, SDKValidationError> { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchV2WebhooksWebhookIdRequestBody' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdRequest$inboundSchema: z.ZodType< PatchV2WebhooksWebhookIdRequest, z.ZodTypeDef, unknown > = z.object({ webhook_id: z.string(), RequestBody: z.lazy(() => PatchV2WebhooksWebhookIdRequestBody$inboundSchema), }).transform((v) => { return remap$(v, { "webhook_id": "webhookId", "RequestBody": "requestBody", }); }); /** @internal */ export type PatchV2WebhooksWebhookIdRequest$Outbound = { webhook_id: string; RequestBody: PatchV2WebhooksWebhookIdRequestBody$Outbound; }; /** @internal */ export const PatchV2WebhooksWebhookIdRequest$outboundSchema: z.ZodType< PatchV2WebhooksWebhookIdRequest$Outbound, z.ZodTypeDef, PatchV2WebhooksWebhookIdRequest > = z.object({ webhookId: z.string(), requestBody: z.lazy(() => PatchV2WebhooksWebhookIdRequestBody$outboundSchema), }).transform((v) => { return remap$(v, { webhookId: "webhook_id", 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 PatchV2WebhooksWebhookIdRequest$ { /** @deprecated use `PatchV2WebhooksWebhookIdRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2WebhooksWebhookIdRequest$inboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2WebhooksWebhookIdRequest$outboundSchema; /** @deprecated use `PatchV2WebhooksWebhookIdRequest$Outbound` instead. */ export type Outbound = PatchV2WebhooksWebhookIdRequest$Outbound; } export function patchV2WebhooksWebhookIdRequestToJSON( patchV2WebhooksWebhookIdRequest: PatchV2WebhooksWebhookIdRequest, ): string { return JSON.stringify( PatchV2WebhooksWebhookIdRequest$outboundSchema.parse( patchV2WebhooksWebhookIdRequest, ), ); } export function patchV2WebhooksWebhookIdRequestFromJSON( jsonString: string, ): SafeParseResult<PatchV2WebhooksWebhookIdRequest, SDKValidationError> { return safeParse( jsonString, (x) => PatchV2WebhooksWebhookIdRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchV2WebhooksWebhookIdRequest' from JSON`, ); } /** @internal */ export const PatchV2WebhooksWebhookIdEventTypeResponse$inboundSchema: z.ZodNativeEnum<typeof PatchV2WebhooksWebhookIdEventTypeResponse> = z .nativeEnum(PatchV2WebhooksWebhookIdEventTypeResponse); /** @internal */ export const PatchV2WebhooksWebhookIdEventTypeResponse$outboundSchema: z.ZodNativeEnum<typeof PatchV2We