/* * 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 PutApiLeadScraperMicroserviceApiV1ApiKeysStatus = { StatusUnspecified: "STATUS_UNSPECIFIED", StatusActive: "STATUS_ACTIVE", StatusSuspended: "STATUS_SUSPENDED", StatusPendingVerification: "STATUS_PENDING_VERIFICATION", StatusRevoked: "STATUS_REVOKED", StatusExpired: "STATUS_EXPIRED", StatusRateLimited: "STATUS_RATE_LIMITED", StatusPendingReview: "STATUS_PENDING_REVIEW", StatusDeprecated: "STATUS_DEPRECATED", StatusMaintenance: "STATUS_MAINTENANCE", } as const; export type PutApiLeadScraperMicroserviceApiV1ApiKeysStatus = ClosedEnum< typeof PutApiLeadScraperMicroserviceApiV1ApiKeysStatus >; export type ApiKey = { id?: string | undefined; name?: string | undefined; keyHash?: string | undefined; keyPrefix?: string | undefined; scopes?: Array | undefined; allowedIps?: Array | undefined; allowedDomains?: Array | undefined; allowedEnvironments?: Array | undefined; isTestKey?: boolean | undefined; requestsPerSecond?: number | undefined; requestsPerDay?: number | undefined; concurrentRequests?: number | undefined; monthlyRequestQuota?: string | undefined; costPerRequest?: number | undefined; billingTier?: string | undefined; totalRequests?: string | undefined; totalErrors?: string | undefined; lastUsedAt?: Date | undefined; averageResponseTime?: number | undefined; endpointUsageJson?: string | undefined; errorRatesJson?: string | undefined; recentErrors?: string | undefined; successfulRequestsCount?: number | undefined; successRate?: number | undefined; status?: PutApiLeadScraperMicroserviceApiV1ApiKeysStatus | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; expiresAt?: Date | undefined; deletedAt?: Date | undefined; lastRotatedAt?: Date | undefined; lastSecurityReviewAt?: Date | undefined; requiresClientSecret?: boolean | undefined; clientSecretHash?: string | undefined; enforceHttps?: boolean | undefined; enforceSigning?: boolean | undefined; allowedSignatureAlgorithms?: Array | undefined; enforceMutualTls?: boolean | undefined; clientCertificateHash?: string | undefined; requireRequestSigning?: boolean | undefined; description?: string | undefined; metadataJson?: string | undefined; tags?: Array | undefined; apiVersion?: string | undefined; supportedFeatures?: Array | undefined; documentationUrl?: string | undefined; supportContact?: string | undefined; logAllRequests?: boolean | undefined; lastRotationReason?: string | undefined; lastRotationDate?: Date | undefined; rotationFrequencyDays?: number | undefined; complianceStandards?: Array | undefined; requiresAuditLogging?: boolean | undefined; dataResidency?: string | undefined; approvedIntegrations?: Array | undefined; alertEmails?: Array | undefined; webhookUrl?: string | undefined; alertOnQuotaThreshold?: boolean | undefined; quotaAlertThreshold?: number | undefined; alertOnErrorSpike?: boolean | undefined; errorAlertThreshold?: number | undefined; monitoringIntegrations?: Array | undefined; encrypted?: boolean | undefined; dataClassification?: string | undefined; maxUses?: number | undefined; rateLimit?: number | undefined; }; export type PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody = { apiKey?: ApiKey | undefined; }; export const PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus = { StatusUnspecified: "STATUS_UNSPECIFIED", StatusActive: "STATUS_ACTIVE", StatusSuspended: "STATUS_SUSPENDED", StatusPendingVerification: "STATUS_PENDING_VERIFICATION", StatusRevoked: "STATUS_REVOKED", StatusExpired: "STATUS_EXPIRED", StatusRateLimited: "STATUS_RATE_LIMITED", StatusPendingReview: "STATUS_PENDING_REVIEW", StatusDeprecated: "STATUS_DEPRECATED", StatusMaintenance: "STATUS_MAINTENANCE", } as const; export type PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus = ClosedEnum< typeof PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus >; export type PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey = { id?: string | undefined; name?: string | undefined; keyHash?: string | undefined; keyPrefix?: string | undefined; scopes?: Array | undefined; allowedIps?: Array | undefined; allowedDomains?: Array | undefined; allowedEnvironments?: Array | undefined; isTestKey?: boolean | undefined; requestsPerSecond?: number | undefined; requestsPerDay?: number | undefined; concurrentRequests?: number | undefined; monthlyRequestQuota?: string | undefined; costPerRequest?: number | undefined; billingTier?: string | undefined; totalRequests?: string | undefined; totalErrors?: string | undefined; lastUsedAt?: Date | undefined; averageResponseTime?: number | undefined; endpointUsageJson?: string | undefined; errorRatesJson?: string | undefined; recentErrors?: string | undefined; successfulRequestsCount?: number | undefined; successRate?: number | undefined; status?: PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; expiresAt?: Date | undefined; deletedAt?: Date | undefined; lastRotatedAt?: Date | undefined; lastSecurityReviewAt?: Date | undefined; requiresClientSecret?: boolean | undefined; clientSecretHash?: string | undefined; enforceHttps?: boolean | undefined; enforceSigning?: boolean | undefined; allowedSignatureAlgorithms?: Array | undefined; enforceMutualTls?: boolean | undefined; clientCertificateHash?: string | undefined; requireRequestSigning?: boolean | undefined; description?: string | undefined; metadataJson?: string | undefined; tags?: Array | undefined; apiVersion?: string | undefined; supportedFeatures?: Array | undefined; documentationUrl?: string | undefined; supportContact?: string | undefined; logAllRequests?: boolean | undefined; lastRotationReason?: string | undefined; lastRotationDate?: Date | undefined; rotationFrequencyDays?: number | undefined; complianceStandards?: Array | undefined; requiresAuditLogging?: boolean | undefined; dataResidency?: string | undefined; approvedIntegrations?: Array | undefined; alertEmails?: Array | undefined; webhookUrl?: string | undefined; alertOnQuotaThreshold?: boolean | undefined; quotaAlertThreshold?: number | undefined; alertOnErrorSpike?: boolean | undefined; errorAlertThreshold?: number | undefined; monitoringIntegrations?: Array | undefined; encrypted?: boolean | undefined; dataClassification?: string | undefined; maxUses?: number | undefined; rateLimit?: number | undefined; }; /** * Updates an existing API key's configuration */ export type PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody = { apiKey?: PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(PutApiLeadScraperMicroserviceApiV1ApiKeysStatus); /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$outboundSchema: z.ZodNativeEnum = PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$outboundSchema; } /** @internal */ export const ApiKey$inboundSchema: z.ZodType = z .object({ id: z.string().optional(), name: z.string().optional(), keyHash: z.string().optional(), keyPrefix: z.string().optional(), scopes: z.array(z.string()).optional(), allowedIps: z.array(z.string()).optional(), allowedDomains: z.array(z.string()).optional(), allowedEnvironments: z.array(z.string()).optional(), isTestKey: z.boolean().optional(), requestsPerSecond: z.number().int().optional(), requestsPerDay: z.number().int().optional(), concurrentRequests: z.number().int().optional(), monthlyRequestQuota: z.string().optional(), costPerRequest: z.number().optional(), billingTier: z.string().optional(), totalRequests: z.string().optional(), totalErrors: z.string().optional(), lastUsedAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), averageResponseTime: z.number().optional(), endpointUsageJson: z.string().optional(), errorRatesJson: z.string().optional(), recentErrors: z.string().optional(), successfulRequestsCount: z.number().int().optional(), successRate: z.number().optional(), status: PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$inboundSchema .default("STATUS_UNSPECIFIED"), createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), expiresAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), deletedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), lastRotatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), lastSecurityReviewAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), requiresClientSecret: z.boolean().optional(), clientSecretHash: z.string().optional(), enforceHttps: z.boolean().optional(), enforceSigning: z.boolean().optional(), allowedSignatureAlgorithms: z.array(z.string()).optional(), enforceMutualTls: z.boolean().optional(), clientCertificateHash: z.string().optional(), requireRequestSigning: z.boolean().optional(), description: z.string().optional(), metadataJson: z.string().optional(), tags: z.array(z.string()).optional(), apiVersion: z.string().optional(), supportedFeatures: z.array(z.string()).optional(), documentationUrl: z.string().optional(), supportContact: z.string().optional(), logAllRequests: z.boolean().optional(), lastRotationReason: z.string().optional(), lastRotationDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), rotationFrequencyDays: z.number().int().optional(), complianceStandards: z.array(z.string()).optional(), requiresAuditLogging: z.boolean().optional(), dataResidency: z.string().optional(), approvedIntegrations: z.array(z.string()).optional(), alertEmails: z.array(z.string()).optional(), webhookUrl: z.string().optional(), alertOnQuotaThreshold: z.boolean().optional(), quotaAlertThreshold: z.number().optional(), alertOnErrorSpike: z.boolean().optional(), errorAlertThreshold: z.number().optional(), monitoringIntegrations: z.array(z.string()).optional(), encrypted: z.boolean().optional(), dataClassification: z.string().optional(), maxUses: z.number().int().optional(), rateLimit: z.number().int().optional(), }); /** @internal */ export type ApiKey$Outbound = { id?: string | undefined; name?: string | undefined; keyHash?: string | undefined; keyPrefix?: string | undefined; scopes?: Array | undefined; allowedIps?: Array | undefined; allowedDomains?: Array | undefined; allowedEnvironments?: Array | undefined; isTestKey?: boolean | undefined; requestsPerSecond?: number | undefined; requestsPerDay?: number | undefined; concurrentRequests?: number | undefined; monthlyRequestQuota?: string | undefined; costPerRequest?: number | undefined; billingTier?: string | undefined; totalRequests?: string | undefined; totalErrors?: string | undefined; lastUsedAt?: string | undefined; averageResponseTime?: number | undefined; endpointUsageJson?: string | undefined; errorRatesJson?: string | undefined; recentErrors?: string | undefined; successfulRequestsCount?: number | undefined; successRate?: number | undefined; status: string; createdAt?: string | undefined; updatedAt?: string | undefined; expiresAt?: string | undefined; deletedAt?: string | undefined; lastRotatedAt?: string | undefined; lastSecurityReviewAt?: string | undefined; requiresClientSecret?: boolean | undefined; clientSecretHash?: string | undefined; enforceHttps?: boolean | undefined; enforceSigning?: boolean | undefined; allowedSignatureAlgorithms?: Array | undefined; enforceMutualTls?: boolean | undefined; clientCertificateHash?: string | undefined; requireRequestSigning?: boolean | undefined; description?: string | undefined; metadataJson?: string | undefined; tags?: Array | undefined; apiVersion?: string | undefined; supportedFeatures?: Array | undefined; documentationUrl?: string | undefined; supportContact?: string | undefined; logAllRequests?: boolean | undefined; lastRotationReason?: string | undefined; lastRotationDate?: string | undefined; rotationFrequencyDays?: number | undefined; complianceStandards?: Array | undefined; requiresAuditLogging?: boolean | undefined; dataResidency?: string | undefined; approvedIntegrations?: Array | undefined; alertEmails?: Array | undefined; webhookUrl?: string | undefined; alertOnQuotaThreshold?: boolean | undefined; quotaAlertThreshold?: number | undefined; alertOnErrorSpike?: boolean | undefined; errorAlertThreshold?: number | undefined; monitoringIntegrations?: Array | undefined; encrypted?: boolean | undefined; dataClassification?: string | undefined; maxUses?: number | undefined; rateLimit?: number | undefined; }; /** @internal */ export const ApiKey$outboundSchema: z.ZodType< ApiKey$Outbound, z.ZodTypeDef, ApiKey > = z.object({ id: z.string().optional(), name: z.string().optional(), keyHash: z.string().optional(), keyPrefix: z.string().optional(), scopes: z.array(z.string()).optional(), allowedIps: z.array(z.string()).optional(), allowedDomains: z.array(z.string()).optional(), allowedEnvironments: z.array(z.string()).optional(), isTestKey: z.boolean().optional(), requestsPerSecond: z.number().int().optional(), requestsPerDay: z.number().int().optional(), concurrentRequests: z.number().int().optional(), monthlyRequestQuota: z.string().optional(), costPerRequest: z.number().optional(), billingTier: z.string().optional(), totalRequests: z.string().optional(), totalErrors: z.string().optional(), lastUsedAt: z.date().transform(v => v.toISOString()).optional(), averageResponseTime: z.number().optional(), endpointUsageJson: z.string().optional(), errorRatesJson: z.string().optional(), recentErrors: z.string().optional(), successfulRequestsCount: z.number().int().optional(), successRate: z.number().optional(), status: PutApiLeadScraperMicroserviceApiV1ApiKeysStatus$outboundSchema .default("STATUS_UNSPECIFIED"), createdAt: z.date().transform(v => v.toISOString()).optional(), updatedAt: z.date().transform(v => v.toISOString()).optional(), expiresAt: z.date().transform(v => v.toISOString()).optional(), deletedAt: z.date().transform(v => v.toISOString()).optional(), lastRotatedAt: z.date().transform(v => v.toISOString()).optional(), lastSecurityReviewAt: z.date().transform(v => v.toISOString()).optional(), requiresClientSecret: z.boolean().optional(), clientSecretHash: z.string().optional(), enforceHttps: z.boolean().optional(), enforceSigning: z.boolean().optional(), allowedSignatureAlgorithms: z.array(z.string()).optional(), enforceMutualTls: z.boolean().optional(), clientCertificateHash: z.string().optional(), requireRequestSigning: z.boolean().optional(), description: z.string().optional(), metadataJson: z.string().optional(), tags: z.array(z.string()).optional(), apiVersion: z.string().optional(), supportedFeatures: z.array(z.string()).optional(), documentationUrl: z.string().optional(), supportContact: z.string().optional(), logAllRequests: z.boolean().optional(), lastRotationReason: z.string().optional(), lastRotationDate: z.date().transform(v => v.toISOString()).optional(), rotationFrequencyDays: z.number().int().optional(), complianceStandards: z.array(z.string()).optional(), requiresAuditLogging: z.boolean().optional(), dataResidency: z.string().optional(), approvedIntegrations: z.array(z.string()).optional(), alertEmails: z.array(z.string()).optional(), webhookUrl: z.string().optional(), alertOnQuotaThreshold: z.boolean().optional(), quotaAlertThreshold: z.number().optional(), alertOnErrorSpike: z.boolean().optional(), errorAlertThreshold: z.number().optional(), monitoringIntegrations: z.array(z.string()).optional(), encrypted: z.boolean().optional(), dataClassification: z.string().optional(), maxUses: z.number().int().optional(), rateLimit: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ApiKey$ { /** @deprecated use `ApiKey$inboundSchema` instead. */ export const inboundSchema = ApiKey$inboundSchema; /** @deprecated use `ApiKey$outboundSchema` instead. */ export const outboundSchema = ApiKey$outboundSchema; /** @deprecated use `ApiKey$Outbound` instead. */ export type Outbound = ApiKey$Outbound; } export function apiKeyToJSON(apiKey: ApiKey): string { return JSON.stringify(ApiKey$outboundSchema.parse(apiKey)); } export function apiKeyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ApiKey$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApiKey' from JSON`, ); } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody, z.ZodTypeDef, unknown > = z.object({ apiKey: z.lazy(() => ApiKey$inboundSchema).optional(), }); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$Outbound = { apiKey?: ApiKey$Outbound | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody > = z.object({ apiKey: z.lazy(() => ApiKey$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 PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$Outbound; } export function putApiLeadScraperMicroserviceApiV1ApiKeysRequestBodyToJSON( putApiLeadScraperMicroserviceApiV1ApiKeysRequestBody: PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$outboundSchema.parse( putApiLeadScraperMicroserviceApiV1ApiKeysRequestBody, ), ); } export function putApiLeadScraperMicroserviceApiV1ApiKeysRequestBodyFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1ApiKeysRequestBody' from JSON`, ); } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$inboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus > = z.nativeEnum(PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus); /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$outboundSchema: z.ZodNativeEnum< typeof PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus > = PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$outboundSchema; } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), name: z.string().optional(), keyHash: z.string().optional(), keyPrefix: z.string().optional(), scopes: z.array(z.string()).optional(), allowedIps: z.array(z.string()).optional(), allowedDomains: z.array(z.string()).optional(), allowedEnvironments: z.array(z.string()).optional(), isTestKey: z.boolean().optional(), requestsPerSecond: z.number().int().optional(), requestsPerDay: z.number().int().optional(), concurrentRequests: z.number().int().optional(), monthlyRequestQuota: z.string().optional(), costPerRequest: z.number().optional(), billingTier: z.string().optional(), totalRequests: z.string().optional(), totalErrors: z.string().optional(), lastUsedAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), averageResponseTime: z.number().optional(), endpointUsageJson: z.string().optional(), errorRatesJson: z.string().optional(), recentErrors: z.string().optional(), successfulRequestsCount: z.number().int().optional(), successRate: z.number().optional(), status: PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$inboundSchema .default("STATUS_UNSPECIFIED"), createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), expiresAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), deletedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), lastRotatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), lastSecurityReviewAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), requiresClientSecret: z.boolean().optional(), clientSecretHash: z.string().optional(), enforceHttps: z.boolean().optional(), enforceSigning: z.boolean().optional(), allowedSignatureAlgorithms: z.array(z.string()).optional(), enforceMutualTls: z.boolean().optional(), clientCertificateHash: z.string().optional(), requireRequestSigning: z.boolean().optional(), description: z.string().optional(), metadataJson: z.string().optional(), tags: z.array(z.string()).optional(), apiVersion: z.string().optional(), supportedFeatures: z.array(z.string()).optional(), documentationUrl: z.string().optional(), supportContact: z.string().optional(), logAllRequests: z.boolean().optional(), lastRotationReason: z.string().optional(), lastRotationDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), rotationFrequencyDays: z.number().int().optional(), complianceStandards: z.array(z.string()).optional(), requiresAuditLogging: z.boolean().optional(), dataResidency: z.string().optional(), approvedIntegrations: z.array(z.string()).optional(), alertEmails: z.array(z.string()).optional(), webhookUrl: z.string().optional(), alertOnQuotaThreshold: z.boolean().optional(), quotaAlertThreshold: z.number().optional(), alertOnErrorSpike: z.boolean().optional(), errorAlertThreshold: z.number().optional(), monitoringIntegrations: z.array(z.string()).optional(), encrypted: z.boolean().optional(), dataClassification: z.string().optional(), maxUses: z.number().int().optional(), rateLimit: z.number().int().optional(), }); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$Outbound = { id?: string | undefined; name?: string | undefined; keyHash?: string | undefined; keyPrefix?: string | undefined; scopes?: Array | undefined; allowedIps?: Array | undefined; allowedDomains?: Array | undefined; allowedEnvironments?: Array | undefined; isTestKey?: boolean | undefined; requestsPerSecond?: number | undefined; requestsPerDay?: number | undefined; concurrentRequests?: number | undefined; monthlyRequestQuota?: string | undefined; costPerRequest?: number | undefined; billingTier?: string | undefined; totalRequests?: string | undefined; totalErrors?: string | undefined; lastUsedAt?: string | undefined; averageResponseTime?: number | undefined; endpointUsageJson?: string | undefined; errorRatesJson?: string | undefined; recentErrors?: string | undefined; successfulRequestsCount?: number | undefined; successRate?: number | undefined; status: string; createdAt?: string | undefined; updatedAt?: string | undefined; expiresAt?: string | undefined; deletedAt?: string | undefined; lastRotatedAt?: string | undefined; lastSecurityReviewAt?: string | undefined; requiresClientSecret?: boolean | undefined; clientSecretHash?: string | undefined; enforceHttps?: boolean | undefined; enforceSigning?: boolean | undefined; allowedSignatureAlgorithms?: Array | undefined; enforceMutualTls?: boolean | undefined; clientCertificateHash?: string | undefined; requireRequestSigning?: boolean | undefined; description?: string | undefined; metadataJson?: string | undefined; tags?: Array | undefined; apiVersion?: string | undefined; supportedFeatures?: Array | undefined; documentationUrl?: string | undefined; supportContact?: string | undefined; logAllRequests?: boolean | undefined; lastRotationReason?: string | undefined; lastRotationDate?: string | undefined; rotationFrequencyDays?: number | undefined; complianceStandards?: Array | undefined; requiresAuditLogging?: boolean | undefined; dataResidency?: string | undefined; approvedIntegrations?: Array | undefined; alertEmails?: Array | undefined; webhookUrl?: string | undefined; alertOnQuotaThreshold?: boolean | undefined; quotaAlertThreshold?: number | undefined; alertOnErrorSpike?: boolean | undefined; errorAlertThreshold?: number | undefined; monitoringIntegrations?: Array | undefined; encrypted?: boolean | undefined; dataClassification?: string | undefined; maxUses?: number | undefined; rateLimit?: number | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey > = z.object({ id: z.string().optional(), name: z.string().optional(), keyHash: z.string().optional(), keyPrefix: z.string().optional(), scopes: z.array(z.string()).optional(), allowedIps: z.array(z.string()).optional(), allowedDomains: z.array(z.string()).optional(), allowedEnvironments: z.array(z.string()).optional(), isTestKey: z.boolean().optional(), requestsPerSecond: z.number().int().optional(), requestsPerDay: z.number().int().optional(), concurrentRequests: z.number().int().optional(), monthlyRequestQuota: z.string().optional(), costPerRequest: z.number().optional(), billingTier: z.string().optional(), totalRequests: z.string().optional(), totalErrors: z.string().optional(), lastUsedAt: z.date().transform(v => v.toISOString()).optional(), averageResponseTime: z.number().optional(), endpointUsageJson: z.string().optional(), errorRatesJson: z.string().optional(), recentErrors: z.string().optional(), successfulRequestsCount: z.number().int().optional(), successRate: z.number().optional(), status: PutApiLeadScraperMicroserviceApiV1ApiKeysApiKeysStatus$outboundSchema .default("STATUS_UNSPECIFIED"), createdAt: z.date().transform(v => v.toISOString()).optional(), updatedAt: z.date().transform(v => v.toISOString()).optional(), expiresAt: z.date().transform(v => v.toISOString()).optional(), deletedAt: z.date().transform(v => v.toISOString()).optional(), lastRotatedAt: z.date().transform(v => v.toISOString()).optional(), lastSecurityReviewAt: z.date().transform(v => v.toISOString()).optional(), requiresClientSecret: z.boolean().optional(), clientSecretHash: z.string().optional(), enforceHttps: z.boolean().optional(), enforceSigning: z.boolean().optional(), allowedSignatureAlgorithms: z.array(z.string()).optional(), enforceMutualTls: z.boolean().optional(), clientCertificateHash: z.string().optional(), requireRequestSigning: z.boolean().optional(), description: z.string().optional(), metadataJson: z.string().optional(), tags: z.array(z.string()).optional(), apiVersion: z.string().optional(), supportedFeatures: z.array(z.string()).optional(), documentationUrl: z.string().optional(), supportContact: z.string().optional(), logAllRequests: z.boolean().optional(), lastRotationReason: z.string().optional(), lastRotationDate: z.date().transform(v => v.toISOString()).optional(), rotationFrequencyDays: z.number().int().optional(), complianceStandards: z.array(z.string()).optional(), requiresAuditLogging: z.boolean().optional(), dataResidency: z.string().optional(), approvedIntegrations: z.array(z.string()).optional(), alertEmails: z.array(z.string()).optional(), webhookUrl: z.string().optional(), alertOnQuotaThreshold: z.boolean().optional(), quotaAlertThreshold: z.number().optional(), alertOnErrorSpike: z.boolean().optional(), errorAlertThreshold: z.number().optional(), monitoringIntegrations: z.array(z.string()).optional(), encrypted: z.boolean().optional(), dataClassification: z.string().optional(), maxUses: z.number().int().optional(), rateLimit: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$Outbound; } export function putApiLeadScraperMicroserviceApiV1ApiKeysApiKeyToJSON( putApiLeadScraperMicroserviceApiV1ApiKeysApiKey: PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$outboundSchema.parse( putApiLeadScraperMicroserviceApiV1ApiKeysApiKey, ), ); } export function putApiLeadScraperMicroserviceApiV1ApiKeysApiKeyFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey' from JSON`, ); } /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$inboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody, z.ZodTypeDef, unknown > = z.object({ apiKey: z.lazy(() => PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$inboundSchema ).optional(), }); /** @internal */ export type PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$Outbound = { apiKey?: PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$Outbound | undefined; }; /** @internal */ export const PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$outboundSchema: z.ZodType< PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$Outbound, z.ZodTypeDef, PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody > = z.object({ apiKey: z.lazy(() => PutApiLeadScraperMicroserviceApiV1ApiKeysApiKey$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 PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$ { /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$inboundSchema` instead. */ export const inboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$inboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$outboundSchema` instead. */ export const outboundSchema = PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$outboundSchema; /** @deprecated use `PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$Outbound` instead. */ export type Outbound = PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$Outbound; } export function putApiLeadScraperMicroserviceApiV1ApiKeysResponseBodyToJSON( putApiLeadScraperMicroserviceApiV1ApiKeysResponseBody: PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody, ): string { return JSON.stringify( PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$outboundSchema.parse( putApiLeadScraperMicroserviceApiV1ApiKeysResponseBody, ), ); } export function putApiLeadScraperMicroserviceApiV1ApiKeysResponseBodyFromJSON( jsonString: string, ): SafeParseResult< PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody, SDKValidationError > { return safeParse( jsonString, (x) => PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutApiLeadScraperMicroserviceApiV1ApiKeysResponseBody' from JSON`, ); }