/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Awss3Credentials = { /** * AWS Access Key ID. */ key: string; /** * AWS Secret Access Key. */ secret: string; /** * Optional AWS Session Token (for temporary credentials). */ session?: string | undefined; }; /** @internal */ export const Awss3Credentials$inboundSchema: z.ZodType< Awss3Credentials, z.ZodTypeDef, unknown > = z.object({ key: z.string(), secret: z.string(), session: z.string().optional(), }); /** @internal */ export type Awss3Credentials$Outbound = { key: string; secret: string; session?: string | undefined; }; /** @internal */ export const Awss3Credentials$outboundSchema: z.ZodType< Awss3Credentials$Outbound, z.ZodTypeDef, Awss3Credentials > = z.object({ key: z.string(), secret: z.string(), session: z.string().optional(), }); export function awss3CredentialsToJSON( awss3Credentials: Awss3Credentials, ): string { return JSON.stringify( Awss3Credentials$outboundSchema.parse(awss3Credentials), ); } export function awss3CredentialsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Awss3Credentials$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Awss3Credentials' from JSON`, ); }