/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { EcommerceAddress, EcommerceAddress$inboundSchema, } from "./ecommerceaddress.js"; export type EcommerceStore = { /** * A unique identifier for an object. */ id: string; /** * The store's name */ name?: string | null | undefined; /** * The store's website URL */ storeUrl?: string | null | undefined; /** * The store's admin login URL */ adminUrl?: string | null | undefined; /** * Seller-side addresses exposed by the platform for this store. Currently holds the store's default shipping origin when the platform designates one. Empty when none is available. */ addresses?: Array | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: { [k: string]: any } | null | undefined; /** * The date and time when the object was created. */ createdAt?: Date | null | undefined; /** * The date and time when the object was last updated. */ updatedAt?: Date | null | undefined; }; /** @internal */ export const EcommerceStore$inboundSchema: z.ZodType< EcommerceStore, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.string(), name: z.nullable(types.string()).optional(), store_url: z.nullable(types.string()).optional(), admin_url: z.nullable(types.string()).optional(), addresses: types.optional(z.array(EcommerceAddress$inboundSchema)), custom_mappings: z.nullable(z.record(z.any())).optional(), created_at: z.nullable(types.date()).optional(), updated_at: z.nullable(types.date()).optional(), }).transform((v) => { return remap$(v, { "store_url": "storeUrl", "admin_url": "adminUrl", "custom_mappings": "customMappings", "created_at": "createdAt", "updated_at": "updatedAt", }); }) ); export function ecommerceStoreFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EcommerceStore$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EcommerceStore' from JSON`, ); }