/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 083ef0493fd3 */ 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"; /** * Detailed location with information about country, state, city etc. */ export type StructuredLocation = { /** * Desk number. */ deskLocation?: string | undefined; /** * Location's timezone, e.g. UTC, PST. */ timezone?: string | undefined; /** * Office address or name. */ address?: string | undefined; /** * Name of the city. */ city?: string | undefined; /** * State code. */ state?: string | undefined; /** * Region information, e.g. NORAM, APAC. */ region?: string | undefined; /** * ZIP Code for the address. */ zipCode?: string | undefined; /** * Country name. */ country?: string | undefined; /** * Alpha-2 or Alpha-3 ISO 3166 country code, e.g. US or USA. */ countryCode?: string | undefined; }; /** @internal */ export const StructuredLocation$inboundSchema: z.ZodType< StructuredLocation, z.ZodTypeDef, unknown > = z.object({ deskLocation: z.string().optional(), timezone: z.string().optional(), address: z.string().optional(), city: z.string().optional(), state: z.string().optional(), region: z.string().optional(), zipCode: z.string().optional(), country: z.string().optional(), countryCode: z.string().optional(), }); /** @internal */ export type StructuredLocation$Outbound = { deskLocation?: string | undefined; timezone?: string | undefined; address?: string | undefined; city?: string | undefined; state?: string | undefined; region?: string | undefined; zipCode?: string | undefined; country?: string | undefined; countryCode?: string | undefined; }; /** @internal */ export const StructuredLocation$outboundSchema: z.ZodType< StructuredLocation$Outbound, z.ZodTypeDef, StructuredLocation > = z.object({ deskLocation: z.string().optional(), timezone: z.string().optional(), address: z.string().optional(), city: z.string().optional(), state: z.string().optional(), region: z.string().optional(), zipCode: z.string().optional(), country: z.string().optional(), countryCode: z.string().optional(), }); export function structuredLocationToJSON( structuredLocation: StructuredLocation, ): string { return JSON.stringify( StructuredLocation$outboundSchema.parse(structuredLocation), ); } export function structuredLocationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StructuredLocation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StructuredLocation' from JSON`, ); }