UNPKG

@docusign/iam-sdk

Version:

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

124 lines 5.02 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 * as types from "../../types/primitives.js"; import { smartUnion } from "../../types/smartUnion.js"; /** * The type of event that triggers the workflow. In this case, the workflow is initiated * * @remarks * by an HTTP request. Future iterations may support additional event types beyond HTTP. */ export const TriggerEventType = { Http: "HTTP", }; /** * The HTTP method used to trigger the workflow. This defines the type of request * * @remarks * that will initiate the workflow (e.g., GET, POST). */ export const MethodResponse = { Get: "GET", Post: "POST", Put: "PUT", Patch: "PATCH", Delete: "DELETE", }; /** @internal */ export const TriggerEventType$inboundSchema = z.nativeEnum(TriggerEventType); /** @internal */ export const MethodResponse$inboundSchema = z.nativeEnum(MethodResponse); /** @internal */ export const TriggerHttpConfig$inboundSchema = z.object({ method: types.optional(MethodResponse$inboundSchema), url: z.nullable(types.string()).optional(), }); export function triggerHttpConfigFromJSON(jsonString) { return safeParse(jsonString, (x) => TriggerHttpConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TriggerHttpConfig' from JSON`); } /** @internal */ export const DefaultValue$inboundSchema = smartUnion([ types.string(), types.number(), types.boolean(), z.record(z.any()), z.array(z.any()), ]); export function defaultValueFromJSON(jsonString) { return safeParse(jsonString, (x) => DefaultValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultValue' from JSON`); } /** @internal */ export const TriggerInputSchema$inboundSchema = z.object({ field_name: types.optional(types.string()), field_data_type: types.optional(types.string()), default_value: types.optional(smartUnion([ types.string(), types.number(), types.boolean(), z.record(z.any()), z.array(z.any()), ])), }).transform((v) => { return remap$(v, { "field_name": "fieldName", "field_data_type": "fieldDataType", "default_value": "defaultValue", }); }); export function triggerInputSchemaFromJSON(jsonString) { return safeParse(jsonString, (x) => TriggerInputSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TriggerInputSchema' from JSON`); } /** @internal */ export const MetadataResponse$inboundSchema = z.object({ created_at: z.nullable(types.date()).optional(), created_by: z.nullable(types.string()).optional(), modified_at: z.nullable(types.date()).optional(), modified_by: z.nullable(types.string()).optional(), request_id: z.nullable(types.string()).optional(), response_timestamp: z.nullable(types.date()).optional(), response_duration_ms: z.nullable(types.number()).optional(), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "created_by": "createdBy", "modified_at": "modifiedAt", "modified_by": "modifiedBy", "request_id": "requestId", "response_timestamp": "responseTimestamp", "response_duration_ms": "responseDurationMs", }); }); export function metadataResponseFromJSON(jsonString) { return safeParse(jsonString, (x) => MetadataResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataResponse' from JSON`); } /** @internal */ export const WorkflowTriggerRequirementsSuccess$inboundSchema = z.object({ trigger_id: types.string().default("00000000-0000-0000-0000-000000000000"), trigger_event_type: types.optional(TriggerEventType$inboundSchema), trigger_http_config: types.optional(z.lazy(() => TriggerHttpConfig$inboundSchema)), trigger_input_schema: types.optional(z.array(z.lazy(() => TriggerInputSchema$inboundSchema))), metadata: types.optional(z.lazy(() => MetadataResponse$inboundSchema)), page_limit: z.nullable(types.number().default(25)), request_id: types.nullable(types.string()), response_timestamp: types.nullable(types.date()), response_duration_ms: types.nullable(types.number()), }).transform((v) => { return remap$(v, { "trigger_id": "triggerId", "trigger_event_type": "triggerEventType", "trigger_http_config": "triggerHttpConfig", "trigger_input_schema": "triggerInputSchema", "page_limit": "pageLimit", "request_id": "requestId", "response_timestamp": "responseTimestamp", "response_duration_ms": "responseDurationMs", }); }); export function workflowTriggerRequirementsSuccessFromJSON(jsonString) { return safeParse(jsonString, (x) => WorkflowTriggerRequirementsSuccess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowTriggerRequirementsSuccess' from JSON`); } //# sourceMappingURL=workflowtriggerrequirementssuccess.js.map