/* * 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"; import { AWSSQSConfig, AWSSQSConfig$inboundSchema, AWSSQSConfig$Outbound, AWSSQSConfig$outboundSchema, } from "./awssqsconfig.js"; import { AWSSQSCredentials, AWSSQSCredentials$inboundSchema, AWSSQSCredentials$Outbound, AWSSQSCredentials$outboundSchema, } from "./awssqscredentials.js"; import { Topics, Topics$inboundSchema, Topics$Outbound, Topics$outboundSchema, } from "./topics.js"; export type DestinationUpdateAWSSQS = { /** * "*" or an array of enabled topics. */ topics?: Topics | undefined; /** * Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. * * @remarks * Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. * If null or empty, all events matching the topic filter will be delivered. * To remove an existing filter when updating a destination, set filter to an empty object `{}`. */ filter?: { [k: string]: any } | null | undefined; config?: AWSSQSConfig | undefined; credentials?: AWSSQSCredentials | undefined; /** * Static key-value pairs merged into event metadata on every attempt. */ deliveryMetadata?: { [k: string]: string } | null | undefined; /** * Arbitrary contextual information stored with the destination. */ metadata?: { [k: string]: string } | null | undefined; }; /** @internal */ export const DestinationUpdateAWSSQS$inboundSchema: z.ZodType< DestinationUpdateAWSSQS, z.ZodTypeDef, unknown > = z.object({ topics: Topics$inboundSchema.optional(), filter: z.nullable(z.record(z.any())).optional(), config: AWSSQSConfig$inboundSchema.optional(), credentials: AWSSQSCredentials$inboundSchema.optional(), delivery_metadata: z.nullable(z.record(z.string())).optional(), metadata: z.nullable(z.record(z.string())).optional(), }).transform((v) => { return remap$(v, { "delivery_metadata": "deliveryMetadata", }); }); /** @internal */ export type DestinationUpdateAWSSQS$Outbound = { topics?: Topics$Outbound | undefined; filter?: { [k: string]: any } | null | undefined; config?: AWSSQSConfig$Outbound | undefined; credentials?: AWSSQSCredentials$Outbound | undefined; delivery_metadata?: { [k: string]: string } | null | undefined; metadata?: { [k: string]: string } | null | undefined; }; /** @internal */ export const DestinationUpdateAWSSQS$outboundSchema: z.ZodType< DestinationUpdateAWSSQS$Outbound, z.ZodTypeDef, DestinationUpdateAWSSQS > = z.object({ topics: Topics$outboundSchema.optional(), filter: z.nullable(z.record(z.any())).optional(), config: AWSSQSConfig$outboundSchema.optional(), credentials: AWSSQSCredentials$outboundSchema.optional(), deliveryMetadata: z.nullable(z.record(z.string())).optional(), metadata: z.nullable(z.record(z.string())).optional(), }).transform((v) => { return remap$(v, { deliveryMetadata: "delivery_metadata", }); }); export function destinationUpdateAWSSQSToJSON( destinationUpdateAWSSQS: DestinationUpdateAWSSQS, ): string { return JSON.stringify( DestinationUpdateAWSSQS$outboundSchema.parse(destinationUpdateAWSSQS), ); } export function destinationUpdateAWSSQSFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DestinationUpdateAWSSQS$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DestinationUpdateAWSSQS' from JSON`, ); }