UNPKG

@docusign/iam-sdk

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.

75 lines (70 loc) 2.5 kB
/* * 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 { WorkspaceRoleSummary, WorkspaceRoleSummary$inboundSchema, } from "./workspacerolesummary.js"; export type GetWorkspaceAssignableRolesResponse = { /** * The list of roles that can be assigned to the workspace */ roles: Array<WorkspaceRoleSummary> | null; /** * The number of roles 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 roles applicable to the request regardless of pagination. It may not always be computed */ totalRowCount?: number | null | undefined; /** * The optional ID of the current role. It may not always be computed */ currentRoleId?: string | null | undefined; }; /** @internal */ export const GetWorkspaceAssignableRolesResponse$inboundSchema: z.ZodType< GetWorkspaceAssignableRolesResponse, z.ZodTypeDef, unknown > = z.object({ roles: types.nullable(z.array(WorkspaceRoleSummary$inboundSchema)), 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(), current_role_id: z.nullable(types.string()).optional(), }).transform((v) => { return remap$(v, { "result_set_size": "resultSetSize", "start_position": "startPosition", "end_position": "endPosition", "total_row_count": "totalRowCount", "current_role_id": "currentRoleId", }); }); export function getWorkspaceAssignableRolesResponseFromJSON( jsonString: string, ): SafeParseResult<GetWorkspaceAssignableRolesResponse, SDKValidationError> { return safeParse( jsonString, (x) => GetWorkspaceAssignableRolesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWorkspaceAssignableRolesResponse' from JSON`, ); }