/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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"; export const PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents = { TriggerEventUnspecified: "TRIGGER_EVENT_UNSPECIFIED", TriggerEventJobStarted: "TRIGGER_EVENT_JOB_STARTED", TriggerEventJobCompleted: "TRIGGER_EVENT_JOB_COMPLETED", TriggerEventJobFailed: "TRIGGER_EVENT_JOB_FAILED", TriggerEventLeadFound: "TRIGGER_EVENT_LEAD_FOUND", TriggerEventQuotaExceeded: "TRIGGER_EVENT_QUOTA_EXCEEDED", TriggerEventErrorThresholdReached: "TRIGGER_EVENT_ERROR_THRESHOLD_REACHED", TriggerEventRateLimitReached: "TRIGGER_EVENT_RATE_LIMIT_REACHED", TriggerEventDataValidationFailed: "TRIGGER_EVENT_DATA_VALIDATION_FAILED", TriggerEventNewProxyNeeded: "TRIGGER_EVENT_NEW_PROXY_NEEDED", TriggerEventScheduledMaintenance: "TRIGGER_EVENT_SCHEDULED_MAINTENANCE", } as const; export type PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents = ClosedEnum; export const PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields = { IncludedFieldUnspecified: "INCLUDED_FIELD_UNSPECIFIED", IncludedFieldName: "INCLUDED_FIELD_NAME", IncludedFieldWebsite: "INCLUDED_FIELD_WEBSITE", IncludedFieldPhone: "INCLUDED_FIELD_PHONE", IncludedFieldAddress: "INCLUDED_FIELD_ADDRESS", IncludedFieldLocation: "INCLUDED_FIELD_LOCATION", IncludedFieldCoordinates: "INCLUDED_FIELD_COORDINATES", IncludedFieldGoogleRating: "INCLUDED_FIELD_GOOGLE_RATING", IncludedFieldReviewCount: "INCLUDED_FIELD_REVIEW_COUNT", IncludedFieldReviews: "INCLUDED_FIELD_REVIEWS", IncludedFieldBusinessHours: "INCLUDED_FIELD_BUSINESS_HOURS", IncludedFieldBusinessStatus: "INCLUDED_FIELD_BUSINESS_STATUS", IncludedFieldPlaceId: "INCLUDED_FIELD_PLACE_ID", IncludedFieldGoogleMapsUrl: "INCLUDED_FIELD_GOOGLE_MAPS_URL", IncludedFieldPhotos: "INCLUDED_FIELD_PHOTOS", IncludedFieldMainPhoto: "INCLUDED_FIELD_MAIN_PHOTO", IncludedFieldBusinessTypes: "INCLUDED_FIELD_BUSINESS_TYPES", IncludedFieldAmenities: "INCLUDED_FIELD_AMENITIES", IncludedFieldPaymentMethods: "INCLUDED_FIELD_PAYMENT_METHODS", IncludedFieldSocialProfiles: "INCLUDED_FIELD_SOCIAL_PROFILES", IncludedFieldEmployeeCount: "INCLUDED_FIELD_EMPLOYEE_COUNT", IncludedFieldRevenueInfo: "INCLUDED_FIELD_REVENUE_INFO", IncludedFieldFoundedYear: "INCLUDED_FIELD_FOUNDED_YEAR", IncludedFieldCertifications: "INCLUDED_FIELD_CERTIFICATIONS", IncludedFieldNaicsCode: "INCLUDED_FIELD_NAICS_CODE", IncludedFieldSicCode: "INCLUDED_FIELD_SIC_CODE", IncludedFieldScrapingMetadata: "INCLUDED_FIELD_SCRAPING_METADATA", IncludedFieldComplianceInfo: "INCLUDED_FIELD_COMPLIANCE_INFO", IncludedFieldAlternatePhones: "INCLUDED_FIELD_ALTERNATE_PHONES", IncludedFieldContactPerson: "INCLUDED_FIELD_CONTACT_PERSON", IncludedFieldContactEmail: "INCLUDED_FIELD_CONTACT_EMAIL", } as const; export type PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields = ClosedEnum; export const PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat = { PayloadFormatUnspecified: "PAYLOAD_FORMAT_UNSPECIFIED", PayloadFormatJson: "PAYLOAD_FORMAT_JSON", PayloadFormatXml: "PAYLOAD_FORMAT_XML", PayloadFormatFormData: "PAYLOAD_FORMAT_FORM_DATA", PayloadFormatProtobuf: "PAYLOAD_FORMAT_PROTOBUF", PayloadFormatYaml: "PAYLOAD_FORMAT_YAML", } as const; export type PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat = ClosedEnum; export type PutApiLeadScraperMicroserviceApiV1WebhooksMetadata = {}; export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhook = { id?: string | undefined; url?: string | undefined; authType?: string | undefined; authToken?: string | undefined; customHeaders?: { [k: string]: string } | undefined; maxRetries?: number | undefined; retryInterval?: string | undefined; triggerEvents?: | Array | undefined; includedFields?: | Array | undefined; includeFullResults?: boolean | undefined; payloadFormat?: | PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat | undefined; verifySsl?: boolean | undefined; signingSecret?: string | undefined; rateLimit?: number | undefined; rateLimitInterval?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; lastTriggeredAt?: Date | undefined; successfulCalls?: number | undefined; failedCalls?: number | undefined; metadata?: PutApiLeadScraperMicroserviceApiV1WebhooksMetadata | undefined; webhookName?: string | undefined; }; export type PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody = { webhook?: PutApiLeadScraperMicroserviceApiV1WebhooksWebhook | undefined; }; export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents = { TriggerEventUnspecified: "TRIGGER_EVENT_UNSPECIFIED", TriggerEventJobStarted: "TRIGGER_EVENT_JOB_STARTED", TriggerEventJobCompleted: "TRIGGER_EVENT_JOB_COMPLETED", TriggerEventJobFailed: "TRIGGER_EVENT_JOB_FAILED", TriggerEventLeadFound: "TRIGGER_EVENT_LEAD_FOUND", TriggerEventQuotaExceeded: "TRIGGER_EVENT_QUOTA_EXCEEDED", TriggerEventErrorThresholdReached: "TRIGGER_EVENT_ERROR_THRESHOLD_REACHED", TriggerEventRateLimitReached: "TRIGGER_EVENT_RATE_LIMIT_REACHED", TriggerEventDataValidationFailed: "TRIGGER_EVENT_DATA_VALIDATION_FAILED", TriggerEventNewProxyNeeded: "TRIGGER_EVENT_NEW_PROXY_NEEDED", TriggerEventScheduledMaintenance: "TRIGGER_EVENT_SCHEDULED_MAINTENANCE", } as const; export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents = ClosedEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents >; export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields = { IncludedFieldUnspecified: "INCLUDED_FIELD_UNSPECIFIED", IncludedFieldName: "INCLUDED_FIELD_NAME", IncludedFieldWebsite: "INCLUDED_FIELD_WEBSITE", IncludedFieldPhone: "INCLUDED_FIELD_PHONE", IncludedFieldAddress: "INCLUDED_FIELD_ADDRESS", IncludedFieldLocation: "INCLUDED_FIELD_LOCATION", IncludedFieldCoordinates: "INCLUDED_FIELD_COORDINATES", IncludedFieldGoogleRating: "INCLUDED_FIELD_GOOGLE_RATING", IncludedFieldReviewCount: "INCLUDED_FIELD_REVIEW_COUNT", IncludedFieldReviews: "INCLUDED_FIELD_REVIEWS", IncludedFieldBusinessHours: "INCLUDED_FIELD_BUSINESS_HOURS", IncludedFieldBusinessStatus: "INCLUDED_FIELD_BUSINESS_STATUS", IncludedFieldPlaceId: "INCLUDED_FIELD_PLACE_ID", IncludedFieldGoogleMapsUrl: "INCLUDED_FIELD_GOOGLE_MAPS_URL", IncludedFieldPhotos: "INCLUDED_FIELD_PHOTOS", IncludedFieldMainPhoto: "INCLUDED_FIELD_MAIN_PHOTO", IncludedFieldBusinessTypes: "INCLUDED_FIELD_BUSINESS_TYPES", IncludedFieldAmenities: "INCLUDED_FIELD_AMENITIES", IncludedFieldPaymentMethods: "INCLUDED_FIELD_PAYMENT_METHODS", IncludedFieldSocialProfiles: "INCLUDED_FIELD_SOCIAL_PROFILES", IncludedFieldEmployeeCount: "INCLUDED_FIELD_EMPLOYEE_COUNT", IncludedFieldRevenueInfo: "INCLUDED_FIELD_REVENUE_INFO", IncludedFieldFoundedYear: "INCLUDED_FIELD_FOUNDED_YEAR", IncludedFieldCertifications: "INCLUDED_FIELD_CERTIFICATIONS", IncludedFieldNaicsCode: "INCLUDED_FIELD_NAICS_CODE", IncludedFieldSicCode: "INCLUDED_FIELD_SIC_CODE", IncludedFieldScrapingMetadata: "INCLUDED_FIELD_SCRAPING_METADATA", IncludedFieldComplianceInfo: "INCLUDED_FIELD_COMPLIANCE_INFO", IncludedFieldAlternatePhones: "INCLUDED_FIELD_ALTERNATE_PHONES", IncludedFieldContactPerson: "INCLUDED_FIELD_CONTACT_PERSON", IncludedFieldContactEmail: "INCLUDED_FIELD_CONTACT_EMAIL", } as const; export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields = ClosedEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields >; export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat = { PayloadFormatUnspecified: "PAYLOAD_FORMAT_UNSPECIFIED", PayloadFormatJson: "PAYLOAD_FORMAT_JSON", PayloadFormatXml: "PAYLOAD_FORMAT_XML", PayloadFormatFormData: "PAYLOAD_FORMAT_FORM_DATA", PayloadFormatProtobuf: "PAYLOAD_FORMAT_PROTOBUF", PayloadFormatYaml: "PAYLOAD_FORMAT_YAML", } as const; export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat = ClosedEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat >; export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata = {}; export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook = { id?: string | undefined; url?: string | undefined; authType?: string | undefined; authToken?: string | undefined; customHeaders?: { [k: string]: string } | undefined; maxRetries?: number | undefined; retryInterval?: string | undefined; triggerEvents?: | Array | undefined; includedFields?: | Array | undefined; includeFullResults?: boolean | undefined; payloadFormat?: | PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat | undefined; verifySsl?: boolean | undefined; signingSecret?: string | undefined; rateLimit?: number | undefined; rateLimitInterval?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; lastTriggeredAt?: Date | undefined; successfulCalls?: number | undefined; failedCalls?: number | undefined; metadata?: | PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata | undefined; webhookName?: string | undefined; }; /** * Updates an existing webhook configuration */ export type PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody = { webhook?: | PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$inboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents > = z.nativeEnum(PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents); /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$outboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents > = PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$outboundSchema; } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$inboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields > = z.nativeEnum(PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields); /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$outboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields > = PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$outboundSchema; } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$inboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat > = z.nativeEnum(PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat); /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$outboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat > = PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$outboundSchema; } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksMetadata, z.ZodTypeDef, unknown > = z.object({}); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$Outbound = {}; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1WebhooksMetadata > = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$Outbound; } export function putApiLeadScraperMicroserviceApiV1WebhooksMetadataToJSON( putApiLeadScraperMicroserviceApiV1WebhooksMetadata: PutApiLeadScraperMicroserviceApiV1WebhooksMetadata, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$outboundSchema.parse( putApiLeadScraperMicroserviceApiV1WebhooksMetadata, ), ); } export function putApiLeadScraperMicroserviceApiV1WebhooksMetadataFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1WebhooksMetadata, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1WebhooksMetadata' from JSON`, ); } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksWebhook, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), url: z.string().optional(), authType: z.string().optional(), authToken: z.string().optional(), customHeaders: z.record(z.string()).optional(), maxRetries: z.number().int().optional(), retryInterval: z.string().optional(), triggerEvents: z.array( PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$inboundSchema, ).optional(), includedFields: z.array( PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$inboundSchema, ).optional(), includeFullResults: z.boolean().optional(), payloadFormat: PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$inboundSchema .default("PAYLOAD_FORMAT_UNSPECIFIED"), verifySsl: z.boolean().optional(), signingSecret: z.string().optional(), rateLimit: z.number().int().optional(), rateLimitInterval: z.string().optional(), createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), lastTriggeredAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), successfulCalls: z.number().int().optional(), failedCalls: z.number().int().optional(), metadata: z.lazy(() => PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$inboundSchema ).optional(), webhookName: z.string().optional(), }); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$Outbound = { id?: string | undefined; url?: string | undefined; authType?: string | undefined; authToken?: string | undefined; customHeaders?: { [k: string]: string } | undefined; maxRetries?: number | undefined; retryInterval?: string | undefined; triggerEvents?: Array | undefined; includedFields?: Array | undefined; includeFullResults?: boolean | undefined; payloadFormat: string; verifySsl?: boolean | undefined; signingSecret?: string | undefined; rateLimit?: number | undefined; rateLimitInterval?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; lastTriggeredAt?: string | undefined; successfulCalls?: number | undefined; failedCalls?: number | undefined; metadata?: | PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$Outbound | undefined; webhookName?: string | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1WebhooksWebhook > = z.object({ id: z.string().optional(), url: z.string().optional(), authType: z.string().optional(), authToken: z.string().optional(), customHeaders: z.record(z.string()).optional(), maxRetries: z.number().int().optional(), retryInterval: z.string().optional(), triggerEvents: z.array( PutApiLeadScraperMicroserviceApiV1WebhooksTriggerEvents$outboundSchema, ).optional(), includedFields: z.array( PutApiLeadScraperMicroserviceApiV1WebhooksIncludedFields$outboundSchema, ).optional(), includeFullResults: z.boolean().optional(), payloadFormat: PutApiLeadScraperMicroserviceApiV1WebhooksPayloadFormat$outboundSchema .default("PAYLOAD_FORMAT_UNSPECIFIED"), verifySsl: z.boolean().optional(), signingSecret: z.string().optional(), rateLimit: z.number().int().optional(), rateLimitInterval: z.string().optional(), createdAt: z.date().transform(v => v.toISOString()).optional(), updatedAt: z.date().transform(v => v.toISOString()).optional(), lastTriggeredAt: z.date().transform(v => v.toISOString()).optional(), successfulCalls: z.number().int().optional(), failedCalls: z.number().int().optional(), metadata: z.lazy(() => PutApiLeadScraperMicroserviceApiV1WebhooksMetadata$outboundSchema ).optional(), webhookName: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$Outbound; } export function putApiLeadScraperMicroserviceApiV1WebhooksWebhookToJSON( putApiLeadScraperMicroserviceApiV1WebhooksWebhook: PutApiLeadScraperMicroserviceApiV1WebhooksWebhook, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$outboundSchema.parse( putApiLeadScraperMicroserviceApiV1WebhooksWebhook, ), ); } export function putApiLeadScraperMicroserviceApiV1WebhooksWebhookFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1WebhooksWebhook, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1WebhooksWebhook' from JSON`, ); } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody, z.ZodTypeDef, unknown > = z.object({ webhook: z.lazy(() => PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$inboundSchema ).optional(), }); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$Outbound = { webhook?: | PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$Outbound | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody > = z.object({ webhook: z.lazy(() => PutApiLeadScraperMicroserviceApiV1WebhooksWebhook$outboundSchema ).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$Outbound; } export function putApiLeadScraperMicroserviceApiV1WebhooksRequestBodyToJSON( putApiLeadScraperMicroserviceApiV1WebhooksRequestBody: PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$outboundSchema.parse( putApiLeadScraperMicroserviceApiV1WebhooksRequestBody, ), ); } export function putApiLeadScraperMicroserviceApiV1WebhooksRequestBodyFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1WebhooksRequestBody' from JSON`, ); } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$inboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents > = z.nativeEnum( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents, ); /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$outboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents > = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$outboundSchema; } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$inboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields > = z.nativeEnum( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields, ); /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$outboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields > = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$outboundSchema; } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$inboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat > = z.nativeEnum( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat, ); /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$outboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat > = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$outboundSchema; } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata, z.ZodTypeDef, unknown > = z.object({}); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$Outbound = {}; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata > = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$Outbound; } export function putApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadataToJSON( putApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata: PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$outboundSchema .parse(putApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata), ); } export function putApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadataFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata' from JSON`, ); } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), url: z.string().optional(), authType: z.string().optional(), authToken: z.string().optional(), customHeaders: z.record(z.string()).optional(), maxRetries: z.number().int().optional(), retryInterval: z.string().optional(), triggerEvents: z.array( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$inboundSchema, ).optional(), includedFields: z.array( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$inboundSchema, ).optional(), includeFullResults: z.boolean().optional(), payloadFormat: PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$inboundSchema .default("PAYLOAD_FORMAT_UNSPECIFIED"), verifySsl: z.boolean().optional(), signingSecret: z.string().optional(), rateLimit: z.number().int().optional(), rateLimitInterval: z.string().optional(), createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), lastTriggeredAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), successfulCalls: z.number().int().optional(), failedCalls: z.number().int().optional(), metadata: z.lazy(() => PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$inboundSchema ).optional(), webhookName: z.string().optional(), }); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$Outbound = { id?: string | undefined; url?: string | undefined; authType?: string | undefined; authToken?: string | undefined; customHeaders?: { [k: string]: string } | undefined; maxRetries?: number | undefined; retryInterval?: string | undefined; triggerEvents?: Array | undefined; includedFields?: Array | undefined; includeFullResults?: boolean | undefined; payloadFormat: string; verifySsl?: boolean | undefined; signingSecret?: string | undefined; rateLimit?: number | undefined; rateLimitInterval?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; lastTriggeredAt?: string | undefined; successfulCalls?: number | undefined; failedCalls?: number | undefined; metadata?: | PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$Outbound | undefined; webhookName?: string | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook > = z.object({ id: z.string().optional(), url: z.string().optional(), authType: z.string().optional(), authToken: z.string().optional(), customHeaders: z.record(z.string()).optional(), maxRetries: z.number().int().optional(), retryInterval: z.string().optional(), triggerEvents: z.array( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksTriggerEvents$outboundSchema, ).optional(), includedFields: z.array( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksIncludedFields$outboundSchema, ).optional(), includeFullResults: z.boolean().optional(), payloadFormat: PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksPayloadFormat$outboundSchema .default("PAYLOAD_FORMAT_UNSPECIFIED"), verifySsl: z.boolean().optional(), signingSecret: z.string().optional(), rateLimit: z.number().int().optional(), rateLimitInterval: z.string().optional(), createdAt: z.date().transform(v => v.toISOString()).optional(), updatedAt: z.date().transform(v => v.toISOString()).optional(), lastTriggeredAt: z.date().transform(v => v.toISOString()).optional(), successfulCalls: z.number().int().optional(), failedCalls: z.number().int().optional(), metadata: z.lazy(() => PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksMetadata$outboundSchema ).optional(), webhookName: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$Outbound; } export function putApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhookToJSON( putApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook: PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$outboundSchema .parse(putApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook), ); } export function putApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhookFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook' from JSON`, ); } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody, z.ZodTypeDef, unknown > = z.object({ webhook: z.lazy(() => PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$inboundSchema ).optional(), }); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$Outbound = { webhook?: | PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$Outbound | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody > = z.object({ webhook: z.lazy(() => PutApiLeadScraperMicroserviceApiV1WebhooksWebhooksWebhook$outboundSchema ).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$Outbound; } export function putApiLeadScraperMicroserviceApiV1WebhooksResponseBodyToJSON( putApiLeadScraperMicroserviceApiV1WebhooksResponseBody: PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$outboundSchema.parse( putApiLeadScraperMicroserviceApiV1WebhooksResponseBody, ), ); } export function putApiLeadScraperMicroserviceApiV1WebhooksResponseBodyFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1WebhooksResponseBody' from JSON`, ); }