/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AWSKinesisConfig = { /** * The name of the AWS Kinesis stream. */ streamName: string; /** * The AWS region where the Kinesis stream is located. */ region: string; /** * Optional. Custom AWS endpoint URL (e.g., for LocalStack or VPC endpoints). */ endpoint?: string | undefined; /** * Optional. JMESPath template to extract the partition key from the event payload (e.g., `metadata."event-id"`). Defaults to event ID. */ partitionKeyTemplate?: string | undefined; }; /** @internal */ export const AWSKinesisConfig$inboundSchema: z.ZodType< AWSKinesisConfig, z.ZodTypeDef, unknown > = z.object({ stream_name: z.string(), region: z.string(), endpoint: z.string().optional(), partition_key_template: z.string().optional(), }).transform((v) => { return remap$(v, { "stream_name": "streamName", "partition_key_template": "partitionKeyTemplate", }); }); /** @internal */ export type AWSKinesisConfig$Outbound = { stream_name: string; region: string; endpoint?: string | undefined; partition_key_template?: string | undefined; }; /** @internal */ export const AWSKinesisConfig$outboundSchema: z.ZodType< AWSKinesisConfig$Outbound, z.ZodTypeDef, AWSKinesisConfig > = z.object({ streamName: z.string(), region: z.string(), endpoint: z.string().optional(), partitionKeyTemplate: z.string().optional(), }).transform((v) => { return remap$(v, { streamName: "stream_name", partitionKeyTemplate: "partition_key_template", }); }); export function awsKinesisConfigToJSON( awsKinesisConfig: AWSKinesisConfig, ): string { return JSON.stringify( AWSKinesisConfig$outboundSchema.parse(awsKinesisConfig), ); } export function awsKinesisConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AWSKinesisConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AWSKinesisConfig' from JSON`, ); }