/* * 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 BackblazeCredentials = { keyId: string; applicationKey: string; region: string; endpoint: string; }; /** @internal */ export const BackblazeCredentials$inboundSchema: z.ZodType< BackblazeCredentials, z.ZodTypeDef, unknown > = z.object({ key_id: z.string(), application_key: z.string(), region: z.string(), endpoint: z.string(), }).transform((v) => { return remap$(v, { "key_id": "keyId", "application_key": "applicationKey", }); }); /** @internal */ export type BackblazeCredentials$Outbound = { key_id: string; application_key: string; region: string; endpoint: string; }; /** @internal */ export const BackblazeCredentials$outboundSchema: z.ZodType< BackblazeCredentials$Outbound, z.ZodTypeDef, BackblazeCredentials > = z.object({ keyId: z.string(), applicationKey: z.string(), region: z.string(), endpoint: z.string(), }).transform((v) => { return remap$(v, { keyId: "key_id", applicationKey: "application_key", }); }); export function backblazeCredentialsToJSON( backblazeCredentials: BackblazeCredentials, ): string { return JSON.stringify( BackblazeCredentials$outboundSchema.parse(backblazeCredentials), ); } export function backblazeCredentialsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BackblazeCredentials$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BackblazeCredentials' from JSON`, ); }