@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
54 lines (49 loc) • 1.52 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 {
ResponseMetadata,
ResponseMetadata$inboundSchema,
} from "./responsemetadata.js";
import { Workflow, Workflow$inboundSchema } from "./workflow.js";
/**
* A list of workflows has been successfully returned.
*/
export type WorkflowsListSuccess = {
/**
* A list of workflows
*/
data?: Array<Workflow> | undefined;
/**
* Control information and metadata for the response.
*/
responseMetadata?: ResponseMetadata | undefined;
};
/** @internal */
export const WorkflowsListSuccess$inboundSchema: z.ZodType<
WorkflowsListSuccess,
z.ZodTypeDef,
unknown
> = z.object({
data: types.optional(z.array(Workflow$inboundSchema)),
response_metadata: types.optional(ResponseMetadata$inboundSchema),
}).transform((v) => {
return remap$(v, {
"response_metadata": "responseMetadata",
});
});
export function workflowsListSuccessFromJSON(
jsonString: string,
): SafeParseResult<WorkflowsListSuccess, SDKValidationError> {
return safeParse(
jsonString,
(x) => WorkflowsListSuccess$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'WorkflowsListSuccess' from JSON`,
);
}