@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
64 lines (59 loc) • 1.88 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";
export type CreateWorkspaceResponse = {
/**
* The ID of the workspace
*/
workspaceId?: string | undefined;
/**
* The name of the workspace
*/
name?: string | null | undefined;
/**
* The date the workspace was created
*/
createdDate?: Date | null | undefined;
/**
* The ID of the user who created the workspace
*/
createdByUserId?: string | null | undefined;
/**
* The list of user IDs of the workspace owners
*/
workspaceOwnerIds?: Array<string> | null | undefined;
};
/** @internal */
export const CreateWorkspaceResponse$inboundSchema: z.ZodType<
CreateWorkspaceResponse,
z.ZodTypeDef,
unknown
> = z.object({
workspace_id: types.optional(types.string()),
name: z.nullable(types.string()).optional(),
created_date: z.nullable(types.date()).optional(),
created_by_user_id: z.nullable(types.string()).optional(),
workspace_owner_ids: z.nullable(z.array(types.string())).optional(),
}).transform((v) => {
return remap$(v, {
"workspace_id": "workspaceId",
"created_date": "createdDate",
"created_by_user_id": "createdByUserId",
"workspace_owner_ids": "workspaceOwnerIds",
});
});
export function createWorkspaceResponseFromJSON(
jsonString: string,
): SafeParseResult<CreateWorkspaceResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => CreateWorkspaceResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'CreateWorkspaceResponse' from JSON`,
);
}