/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Asset, Asset$inboundSchema, Asset$Outbound, Asset$outboundSchema, } from "./asset.js"; /** * ListAssetsResponse is the response message for ListAssets method. */ export type ListAssetsResponse = { /** * The assets returned in the response. */ assets?: Array | undefined; /** * The next_page_token value to include in a subsequent ListAssets request to retrieve the next page of results. */ nextPageToken?: string | undefined; }; /** @internal */ export const ListAssetsResponse$inboundSchema: z.ZodType< ListAssetsResponse, z.ZodTypeDef, unknown > = z.object({ assets: z.array(Asset$inboundSchema).optional(), next_page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListAssetsResponse$Outbound = { assets?: Array | undefined; next_page_token?: string | undefined; }; /** @internal */ export const ListAssetsResponse$outboundSchema: z.ZodType< ListAssetsResponse$Outbound, z.ZodTypeDef, ListAssetsResponse > = z.object({ assets: z.array(Asset$outboundSchema).optional(), nextPageToken: z.string().optional(), }).transform((v) => { return remap$(v, { nextPageToken: "next_page_token", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListAssetsResponse$ { /** @deprecated use `ListAssetsResponse$inboundSchema` instead. */ export const inboundSchema = ListAssetsResponse$inboundSchema; /** @deprecated use `ListAssetsResponse$outboundSchema` instead. */ export const outboundSchema = ListAssetsResponse$outboundSchema; /** @deprecated use `ListAssetsResponse$Outbound` instead. */ export type Outbound = ListAssetsResponse$Outbound; } export function listAssetsResponseToJSON( listAssetsResponse: ListAssetsResponse, ): string { return JSON.stringify( ListAssetsResponse$outboundSchema.parse(listAssetsResponse), ); } export function listAssetsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListAssetsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListAssetsResponse' from JSON`, ); }