/* * 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 type PostApiLeadScraperMicroserviceApiV1JobsRequestBody = { authPlatformUserId: string; orgId: string; tenantId: string; name?: string | undefined; keywords?: Array | undefined; lang?: string | undefined; zoom?: number | undefined; lat?: string | undefined; lon?: string | undefined; fastMode?: boolean | undefined; radius?: number | undefined; depth?: number | undefined; email?: boolean | undefined; maxTime?: number | undefined; proxies?: Array | undefined; }; export const PostApiLeadScraperMicroserviceApiV1JobsStatus = { BackgroundJobStatusUnspecified: "BACKGROUND_JOB_STATUS_UNSPECIFIED", BackgroundJobStatusQueued: "BACKGROUND_JOB_STATUS_QUEUED", BackgroundJobStatusInProgress: "BACKGROUND_JOB_STATUS_IN_PROGRESS", BackgroundJobStatusCompleted: "BACKGROUND_JOB_STATUS_COMPLETED", BackgroundJobStatusFailed: "BACKGROUND_JOB_STATUS_FAILED", BackgroundJobStatusCancelled: "BACKGROUND_JOB_STATUS_CANCELLED", BackgroundJobStatusTimedOut: "BACKGROUND_JOB_STATUS_TIMED_OUT", } as const; export type PostApiLeadScraperMicroserviceApiV1JobsStatus = ClosedEnum< typeof PostApiLeadScraperMicroserviceApiV1JobsStatus >; /** * This endpoint creates a new Google Maps scraping job */ export type PostApiLeadScraperMicroserviceApiV1JobsResponseBody = { jobId?: string | undefined; status?: PostApiLeadScraperMicroserviceApiV1JobsStatus | undefined; }; /** @internal */ export const PostApiLeadScraperMicroserviceApiV1JobsRequestBody$inboundSchema: z.ZodType< PostApiLeadScraperMicroserviceApiV1JobsRequestBody, z.ZodTypeDef, unknown > = z.object({ authPlatformUserId: z.string(), orgId: z.string(), tenantId: z.string(), name: z.string().optional(), keywords: z.array(z.string()).optional(), lang: z.string().optional(), zoom: z.number().int().optional(), lat: z.string().optional(), lon: z.string().optional(), fastMode: z.boolean().optional(), radius: z.number().int().optional(), depth: z.number().int().optional(), email: z.boolean().optional(), maxTime: z.number().int().optional(), proxies: z.array(z.string()).optional(), }); /** @internal */ export type PostApiLeadScraperMicroserviceApiV1JobsRequestBody$Outbound = { authPlatformUserId: string; orgId: string; tenantId: string; name?: string | undefined; keywords?: Array | undefined; lang?: string | undefined; zoom?: number | undefined; lat?: string | undefined; lon?: string | undefined; fastMode?: boolean | undefined; radius?: number | undefined; depth?: number | undefined; email?: boolean | undefined; maxTime?: number | undefined; proxies?: Array | undefined; }; /** @internal */ export const PostApiLeadScraperMicroserviceApiV1JobsRequestBody$outboundSchema: z.ZodType< PostApiLeadScraperMicroserviceApiV1JobsRequestBody$Outbound, z.ZodTypeDef, PostApiLeadScraperMicroserviceApiV1JobsRequestBody > = z.object({ authPlatformUserId: z.string(), orgId: z.string(), tenantId: z.string(), name: z.string().optional(), keywords: z.array(z.string()).optional(), lang: z.string().optional(), zoom: z.number().int().optional(), lat: z.string().optional(), lon: z.string().optional(), fastMode: z.boolean().optional(), radius: z.number().int().optional(), depth: z.number().int().optional(), email: z.boolean().optional(), maxTime: z.number().int().optional(), proxies: z.array(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 PostApiLeadScraperMicroserviceApiV1JobsRequestBody$ { /** @deprecated use `PostApiLeadScraperMicroserviceApiV1JobsRequestBody$inboundSchema` instead. */ export const inboundSchema = PostApiLeadScraperMicroserviceApiV1JobsRequestBody$inboundSchema; /** @deprecated use `PostApiLeadScraperMicroserviceApiV1JobsRequestBody$outboundSchema` instead. */ export const outboundSchema = PostApiLeadScraperMicroserviceApiV1JobsRequestBody$outboundSchema; /** @deprecated use `PostApiLeadScraperMicroserviceApiV1JobsRequestBody$Outbound` instead. */ export type Outbound = PostApiLeadScraperMicroserviceApiV1JobsRequestBody$Outbound; } export function postApiLeadScraperMicroserviceApiV1JobsRequestBodyToJSON( postApiLeadScraperMicroserviceApiV1JobsRequestBody: PostApiLeadScraperMicroserviceApiV1JobsRequestBody, ): string { return JSON.stringify( PostApiLeadScraperMicroserviceApiV1JobsRequestBody$outboundSchema.parse( postApiLeadScraperMicroserviceApiV1JobsRequestBody, ), ); } export function postApiLeadScraperMicroserviceApiV1JobsRequestBodyFromJSON( jsonString: string, ): SafeParseResult< PostApiLeadScraperMicroserviceApiV1JobsRequestBody, SDKValidationError > { return safeParse( jsonString, (x) => PostApiLeadScraperMicroserviceApiV1JobsRequestBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostApiLeadScraperMicroserviceApiV1JobsRequestBody' from JSON`, ); } /** @internal */ export const PostApiLeadScraperMicroserviceApiV1JobsStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(PostApiLeadScraperMicroserviceApiV1JobsStatus); /** @internal */ export const PostApiLeadScraperMicroserviceApiV1JobsStatus$outboundSchema: z.ZodNativeEnum = PostApiLeadScraperMicroserviceApiV1JobsStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PostApiLeadScraperMicroserviceApiV1JobsStatus$ { /** @deprecated use `PostApiLeadScraperMicroserviceApiV1JobsStatus$inboundSchema` instead. */ export const inboundSchema = PostApiLeadScraperMicroserviceApiV1JobsStatus$inboundSchema; /** @deprecated use `PostApiLeadScraperMicroserviceApiV1JobsStatus$outboundSchema` instead. */ export const outboundSchema = PostApiLeadScraperMicroserviceApiV1JobsStatus$outboundSchema; } /** @internal */ export const PostApiLeadScraperMicroserviceApiV1JobsResponseBody$inboundSchema: z.ZodType< PostApiLeadScraperMicroserviceApiV1JobsResponseBody, z.ZodTypeDef, unknown > = z.object({ jobId: z.string().optional(), status: PostApiLeadScraperMicroserviceApiV1JobsStatus$inboundSchema.default( "BACKGROUND_JOB_STATUS_UNSPECIFIED", ), }); /** @internal */ export type PostApiLeadScraperMicroserviceApiV1JobsResponseBody$Outbound = { jobId?: string | undefined; status: string; }; /** @internal */ export const PostApiLeadScraperMicroserviceApiV1JobsResponseBody$outboundSchema: z.ZodType< PostApiLeadScraperMicroserviceApiV1JobsResponseBody$Outbound, z.ZodTypeDef, PostApiLeadScraperMicroserviceApiV1JobsResponseBody > = z.object({ jobId: z.string().optional(), status: PostApiLeadScraperMicroserviceApiV1JobsStatus$outboundSchema .default("BACKGROUND_JOB_STATUS_UNSPECIFIED"), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PostApiLeadScraperMicroserviceApiV1JobsResponseBody$ { /** @deprecated use `PostApiLeadScraperMicroserviceApiV1JobsResponseBody$inboundSchema` instead. */ export const inboundSchema = PostApiLeadScraperMicroserviceApiV1JobsResponseBody$inboundSchema; /** @deprecated use `PostApiLeadScraperMicroserviceApiV1JobsResponseBody$outboundSchema` instead. */ export const outboundSchema = PostApiLeadScraperMicroserviceApiV1JobsResponseBody$outboundSchema; /** @deprecated use `PostApiLeadScraperMicroserviceApiV1JobsResponseBody$Outbound` instead. */ export type Outbound = PostApiLeadScraperMicroserviceApiV1JobsResponseBody$Outbound; } export function postApiLeadScraperMicroserviceApiV1JobsResponseBodyToJSON( postApiLeadScraperMicroserviceApiV1JobsResponseBody: PostApiLeadScraperMicroserviceApiV1JobsResponseBody, ): string { return JSON.stringify( PostApiLeadScraperMicroserviceApiV1JobsResponseBody$outboundSchema.parse( postApiLeadScraperMicroserviceApiV1JobsResponseBody, ), ); } export function postApiLeadScraperMicroserviceApiV1JobsResponseBodyFromJSON( jsonString: string, ): SafeParseResult< PostApiLeadScraperMicroserviceApiV1JobsResponseBody, SDKValidationError > { return safeParse( jsonString, (x) => PostApiLeadScraperMicroserviceApiV1JobsResponseBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostApiLeadScraperMicroserviceApiV1JobsResponseBody' from JSON`, ); }