/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 3f8b71236bb8 */ import * as z from "zod/v4"; 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 UsersApiListWorkspacesSecurity = { dashboardUserContextAuth: string; }; export type UsersApiListWorkspacesRequest = { /** * Return only workspaces belonging to this organization. */ organizationId?: string | null | undefined; /** * Number of workspaces to skip before returning results. */ offset?: number | undefined; /** * Maximum number of workspaces to return. */ limit?: number | undefined; }; export type UsersApiListWorkspacesResponse = { result: components.ListWorkspacesResponse; }; /** @internal */ export type UsersApiListWorkspacesSecurity$Outbound = { DashboardUserContextAuth: string; }; /** @internal */ export const UsersApiListWorkspacesSecurity$outboundSchema: z.ZodType< UsersApiListWorkspacesSecurity$Outbound, UsersApiListWorkspacesSecurity > = z.object({ dashboardUserContextAuth: z.string(), }).transform((v) => { return remap$(v, { dashboardUserContextAuth: "DashboardUserContextAuth", }); }); export function usersApiListWorkspacesSecurityToJSON( usersApiListWorkspacesSecurity: UsersApiListWorkspacesSecurity, ): string { return JSON.stringify( UsersApiListWorkspacesSecurity$outboundSchema.parse( usersApiListWorkspacesSecurity, ), ); } /** @internal */ export type UsersApiListWorkspacesRequest$Outbound = { organization_id?: string | null | undefined; offset: number; limit: number; }; /** @internal */ export const UsersApiListWorkspacesRequest$outboundSchema: z.ZodType< UsersApiListWorkspacesRequest$Outbound, UsersApiListWorkspacesRequest > = z.object({ organizationId: z.nullable(z.string()).optional(), offset: z.int().default(0), limit: z.int().default(100), }).transform((v) => { return remap$(v, { organizationId: "organization_id", }); }); export function usersApiListWorkspacesRequestToJSON( usersApiListWorkspacesRequest: UsersApiListWorkspacesRequest, ): string { return JSON.stringify( UsersApiListWorkspacesRequest$outboundSchema.parse( usersApiListWorkspacesRequest, ), ); } /** @internal */ export const UsersApiListWorkspacesResponse$inboundSchema: z.ZodType< UsersApiListWorkspacesResponse, unknown > = z.object({ Result: components.ListWorkspacesResponse$inboundSchema, }).transform((v) => { return remap$(v, { "Result": "result", }); }); export function usersApiListWorkspacesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UsersApiListWorkspacesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UsersApiListWorkspacesResponse' from JSON`, ); }