@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
68 lines (63 loc) • 2.21 kB
text/typescript
/*
* 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 { 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 {
WorkspaceSummary,
WorkspaceSummary$inboundSchema,
} from "./workspacesummary.js";
export type GetWorkspacesResponse = {
/**
* The workspace summary list. Includes the ID, name, and creation metadata
*/
workspaces?: Array<WorkspaceSummary> | null | undefined;
/**
* The number of workspaces returned in the response. Always equal or less than the `count` of the request
*/
resultSetSize?: number | null | undefined;
/**
* Position of the first item in the total results
*/
startPosition?: number | null | undefined;
/**
* Position of the last item in the total results
*/
endPosition?: number | null | undefined;
/**
* The total number of workspaces applicable to the request regardless of pagination. It may not always be computed
*/
totalRowCount?: number | null | undefined;
};
/** @internal */
export const GetWorkspacesResponse$inboundSchema: z.ZodType<
GetWorkspacesResponse,
z.ZodTypeDef,
unknown
> = z.object({
workspaces: z.nullable(z.array(WorkspaceSummary$inboundSchema)).optional(),
result_set_size: z.nullable(types.number()).optional(),
start_position: z.nullable(types.number()).optional(),
end_position: z.nullable(types.number()).optional(),
total_row_count: z.nullable(types.number()).optional(),
}).transform((v) => {
return remap$(v, {
"result_set_size": "resultSetSize",
"start_position": "startPosition",
"end_position": "endPosition",
"total_row_count": "totalRowCount",
});
});
export function getWorkspacesResponseFromJSON(
jsonString: string,
): SafeParseResult<GetWorkspacesResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetWorkspacesResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetWorkspacesResponse' from JSON`,
);
}