/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type TestingAccountPhoneGetSecurity = { apiKey: string; }; export type TestingAccountPhoneGetRequest = { /** * The publicly shareable identifier used to identify your Bolt merchant division. */ xPublishableKey: string; }; export type TestingAccountPhoneGetResponse = { /** * HTTP response content type for this operation */ contentType: string; /** * HTTP response status code for this operation */ statusCode: number; /** * Raw HTTP response; suitable for custom response parsing */ rawResponse: Response; /** * Successfully generated a random, fictitious, unassigned phone number. */ accountTestPhoneData?: components.AccountTestPhoneData | undefined; }; /** @internal */ export const TestingAccountPhoneGetSecurity$inboundSchema: z.ZodType< TestingAccountPhoneGetSecurity, z.ZodTypeDef, unknown > = z.object({ "api-key": z.string(), }).transform((v) => { return remap$(v, { "api-key": "apiKey", }); }); /** @internal */ export type TestingAccountPhoneGetSecurity$Outbound = { "api-key": string; }; /** @internal */ export const TestingAccountPhoneGetSecurity$outboundSchema: z.ZodType< TestingAccountPhoneGetSecurity$Outbound, z.ZodTypeDef, TestingAccountPhoneGetSecurity > = z.object({ apiKey: z.string(), }).transform((v) => { return remap$(v, { apiKey: "api-key", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TestingAccountPhoneGetSecurity$ { /** @deprecated use `TestingAccountPhoneGetSecurity$inboundSchema` instead. */ export const inboundSchema = TestingAccountPhoneGetSecurity$inboundSchema; /** @deprecated use `TestingAccountPhoneGetSecurity$outboundSchema` instead. */ export const outboundSchema = TestingAccountPhoneGetSecurity$outboundSchema; /** @deprecated use `TestingAccountPhoneGetSecurity$Outbound` instead. */ export type Outbound = TestingAccountPhoneGetSecurity$Outbound; } export function testingAccountPhoneGetSecurityToJSON( testingAccountPhoneGetSecurity: TestingAccountPhoneGetSecurity, ): string { return JSON.stringify( TestingAccountPhoneGetSecurity$outboundSchema.parse( testingAccountPhoneGetSecurity, ), ); } export function testingAccountPhoneGetSecurityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TestingAccountPhoneGetSecurity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TestingAccountPhoneGetSecurity' from JSON`, ); } /** @internal */ export const TestingAccountPhoneGetRequest$inboundSchema: z.ZodType< TestingAccountPhoneGetRequest, z.ZodTypeDef, unknown > = z.object({ "X-Publishable-Key": z.string(), }).transform((v) => { return remap$(v, { "X-Publishable-Key": "xPublishableKey", }); }); /** @internal */ export type TestingAccountPhoneGetRequest$Outbound = { "X-Publishable-Key": string; }; /** @internal */ export const TestingAccountPhoneGetRequest$outboundSchema: z.ZodType< TestingAccountPhoneGetRequest$Outbound, z.ZodTypeDef, TestingAccountPhoneGetRequest > = z.object({ xPublishableKey: z.string(), }).transform((v) => { return remap$(v, { xPublishableKey: "X-Publishable-Key", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TestingAccountPhoneGetRequest$ { /** @deprecated use `TestingAccountPhoneGetRequest$inboundSchema` instead. */ export const inboundSchema = TestingAccountPhoneGetRequest$inboundSchema; /** @deprecated use `TestingAccountPhoneGetRequest$outboundSchema` instead. */ export const outboundSchema = TestingAccountPhoneGetRequest$outboundSchema; /** @deprecated use `TestingAccountPhoneGetRequest$Outbound` instead. */ export type Outbound = TestingAccountPhoneGetRequest$Outbound; } export function testingAccountPhoneGetRequestToJSON( testingAccountPhoneGetRequest: TestingAccountPhoneGetRequest, ): string { return JSON.stringify( TestingAccountPhoneGetRequest$outboundSchema.parse( testingAccountPhoneGetRequest, ), ); } export function testingAccountPhoneGetRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TestingAccountPhoneGetRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TestingAccountPhoneGetRequest' from JSON`, ); } /** @internal */ export const TestingAccountPhoneGetResponse$inboundSchema: z.ZodType< TestingAccountPhoneGetResponse, z.ZodTypeDef, unknown > = z.object({ ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), "account-test-phone-data": components.AccountTestPhoneData$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "ContentType": "contentType", "StatusCode": "statusCode", "RawResponse": "rawResponse", "account-test-phone-data": "accountTestPhoneData", }); }); /** @internal */ export type TestingAccountPhoneGetResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; "account-test-phone-data"?: | components.AccountTestPhoneData$Outbound | undefined; }; /** @internal */ export const TestingAccountPhoneGetResponse$outboundSchema: z.ZodType< TestingAccountPhoneGetResponse$Outbound, z.ZodTypeDef, TestingAccountPhoneGetResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), accountTestPhoneData: components.AccountTestPhoneData$outboundSchema .optional(), }).transform((v) => { return remap$(v, { contentType: "ContentType", statusCode: "StatusCode", rawResponse: "RawResponse", accountTestPhoneData: "account-test-phone-data", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TestingAccountPhoneGetResponse$ { /** @deprecated use `TestingAccountPhoneGetResponse$inboundSchema` instead. */ export const inboundSchema = TestingAccountPhoneGetResponse$inboundSchema; /** @deprecated use `TestingAccountPhoneGetResponse$outboundSchema` instead. */ export const outboundSchema = TestingAccountPhoneGetResponse$outboundSchema; /** @deprecated use `TestingAccountPhoneGetResponse$Outbound` instead. */ export type Outbound = TestingAccountPhoneGetResponse$Outbound; } export function testingAccountPhoneGetResponseToJSON( testingAccountPhoneGetResponse: TestingAccountPhoneGetResponse, ): string { return JSON.stringify( TestingAccountPhoneGetResponse$outboundSchema.parse( testingAccountPhoneGetResponse, ), ); } export function testingAccountPhoneGetResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TestingAccountPhoneGetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TestingAccountPhoneGetResponse' from JSON`, ); }