@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
101 lines (92 loc) • 2.94 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
ResponseMetadata,
ResponseMetadata$inboundSchema,
ResponseMetadata$Outbound,
ResponseMetadata$outboundSchema,
} from "./responsemetadata.js";
import {
WorkflowList,
WorkflowList$inboundSchema,
WorkflowList$Outbound,
WorkflowList$outboundSchema,
} from "./workflowlist.js";
/**
* A list of workflows has been successfully returned.
*/
export type WorkflowsListSuccess = {
/**
* A list of workflows
*/
data?: WorkflowList | 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: WorkflowList$inboundSchema.optional(),
response_metadata: ResponseMetadata$inboundSchema.optional(),
}).transform((v) => {
return remap$(v, {
"response_metadata": "responseMetadata",
});
});
/** @internal */
export type WorkflowsListSuccess$Outbound = {
data?: WorkflowList$Outbound | undefined;
response_metadata?: ResponseMetadata$Outbound | undefined;
};
/** @internal */
export const WorkflowsListSuccess$outboundSchema: z.ZodType<
WorkflowsListSuccess$Outbound,
z.ZodTypeDef,
WorkflowsListSuccess
> = z.object({
data: WorkflowList$outboundSchema.optional(),
responseMetadata: ResponseMetadata$outboundSchema.optional(),
}).transform((v) => {
return remap$(v, {
responseMetadata: "response_metadata",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace WorkflowsListSuccess$ {
/** @deprecated use `WorkflowsListSuccess$inboundSchema` instead. */
export const inboundSchema = WorkflowsListSuccess$inboundSchema;
/** @deprecated use `WorkflowsListSuccess$outboundSchema` instead. */
export const outboundSchema = WorkflowsListSuccess$outboundSchema;
/** @deprecated use `WorkflowsListSuccess$Outbound` instead. */
export type Outbound = WorkflowsListSuccess$Outbound;
}
export function workflowsListSuccessToJSON(
workflowsListSuccess: WorkflowsListSuccess,
): string {
return JSON.stringify(
WorkflowsListSuccess$outboundSchema.parse(workflowsListSuccess),
);
}
export function workflowsListSuccessFromJSON(
jsonString: string,
): SafeParseResult<WorkflowsListSuccess, SDKValidationError> {
return safeParse(
jsonString,
(x) => WorkflowsListSuccess$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'WorkflowsListSuccess' from JSON`,
);
}