/* * 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"; /** * Fields to include in the response. Use bracket notation for multiple values (e.g., `include[0]=event&include[1]=response_data`). * * @remarks * - `event`: Include event summary * - `event.data`: Include full event with payload data * - `response_data`: Include response body and headers * - `destination`: Include the full destination object */ export type GetTenantDestinationAttemptInclude = string | Array; export type GetTenantDestinationAttemptRequest = { /** * The ID of the tenant. Required when using AdminApiKey authentication. */ tenantId: string; /** * The ID of the destination. */ destinationId: string; /** * The ID of the attempt. */ attemptId: string; /** * Fields to include in the response. Use bracket notation for multiple values (e.g., `include[0]=event&include[1]=response_data`). * * @remarks * - `event`: Include event summary * - `event.data`: Include full event with payload data * - `response_data`: Include response body and headers * - `destination`: Include the full destination object */ include?: string | Array | undefined; }; /** @internal */ export const GetTenantDestinationAttemptInclude$inboundSchema: z.ZodType< GetTenantDestinationAttemptInclude, z.ZodTypeDef, unknown > = z.union([z.string(), z.array(z.string())]); /** @internal */ export type GetTenantDestinationAttemptInclude$Outbound = | string | Array; /** @internal */ export const GetTenantDestinationAttemptInclude$outboundSchema: z.ZodType< GetTenantDestinationAttemptInclude$Outbound, z.ZodTypeDef, GetTenantDestinationAttemptInclude > = z.union([z.string(), z.array(z.string())]); export function getTenantDestinationAttemptIncludeToJSON( getTenantDestinationAttemptInclude: GetTenantDestinationAttemptInclude, ): string { return JSON.stringify( GetTenantDestinationAttemptInclude$outboundSchema.parse( getTenantDestinationAttemptInclude, ), ); } export function getTenantDestinationAttemptIncludeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetTenantDestinationAttemptInclude$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetTenantDestinationAttemptInclude' from JSON`, ); } /** @internal */ export const GetTenantDestinationAttemptRequest$inboundSchema: z.ZodType< GetTenantDestinationAttemptRequest, z.ZodTypeDef, unknown > = z.object({ tenant_id: z.string(), destination_id: z.string(), attempt_id: z.string(), include: z.union([z.string(), z.array(z.string())]).optional(), }).transform((v) => { return remap$(v, { "tenant_id": "tenantId", "destination_id": "destinationId", "attempt_id": "attemptId", }); }); /** @internal */ export type GetTenantDestinationAttemptRequest$Outbound = { tenant_id: string; destination_id: string; attempt_id: string; include?: string | Array | undefined; }; /** @internal */ export const GetTenantDestinationAttemptRequest$outboundSchema: z.ZodType< GetTenantDestinationAttemptRequest$Outbound, z.ZodTypeDef, GetTenantDestinationAttemptRequest > = z.object({ tenantId: z.string(), destinationId: z.string(), attemptId: z.string(), include: z.union([z.string(), z.array(z.string())]).optional(), }).transform((v) => { return remap$(v, { tenantId: "tenant_id", destinationId: "destination_id", attemptId: "attempt_id", }); }); export function getTenantDestinationAttemptRequestToJSON( getTenantDestinationAttemptRequest: GetTenantDestinationAttemptRequest, ): string { return JSON.stringify( GetTenantDestinationAttemptRequest$outboundSchema.parse( getTenantDestinationAttemptRequest, ), ); } export function getTenantDestinationAttemptRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetTenantDestinationAttemptRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetTenantDestinationAttemptRequest' from JSON`, ); }