UNPKG

@docusign/iam-sdk

Version:

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

244 lines 10.2 kB
/* * 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 { ResourceMetadata$inboundSchema, ResourceMetadata$outboundSchema, } from "./resourcemetadata.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 Method = { Get: "GET", Post: "POST", Put: "PUT", Patch: "PATCH", Delete: "DELETE", }; /** @internal */ export const TriggerEventType$inboundSchema = z.nativeEnum(TriggerEventType); /** @internal */ export const TriggerEventType$outboundSchema = TriggerEventType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var TriggerEventType$; (function (TriggerEventType$) { /** @deprecated use `TriggerEventType$inboundSchema` instead. */ TriggerEventType$.inboundSchema = TriggerEventType$inboundSchema; /** @deprecated use `TriggerEventType$outboundSchema` instead. */ TriggerEventType$.outboundSchema = TriggerEventType$outboundSchema; })(TriggerEventType$ || (TriggerEventType$ = {})); /** @internal */ export const Method$inboundSchema = z .nativeEnum(Method); /** @internal */ export const Method$outboundSchema = Method$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var Method$; (function (Method$) { /** @deprecated use `Method$inboundSchema` instead. */ Method$.inboundSchema = Method$inboundSchema; /** @deprecated use `Method$outboundSchema` instead. */ Method$.outboundSchema = Method$outboundSchema; })(Method$ || (Method$ = {})); /** @internal */ export const TriggerHttpConfig$inboundSchema = z.object({ method: Method$inboundSchema.optional(), url: z.string().optional(), }); /** @internal */ export const TriggerHttpConfig$outboundSchema = z.object({ method: Method$outboundSchema.optional(), url: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var TriggerHttpConfig$; (function (TriggerHttpConfig$) { /** @deprecated use `TriggerHttpConfig$inboundSchema` instead. */ TriggerHttpConfig$.inboundSchema = TriggerHttpConfig$inboundSchema; /** @deprecated use `TriggerHttpConfig$outboundSchema` instead. */ TriggerHttpConfig$.outboundSchema = TriggerHttpConfig$outboundSchema; })(TriggerHttpConfig$ || (TriggerHttpConfig$ = {})); export function triggerHttpConfigToJSON(triggerHttpConfig) { return JSON.stringify(TriggerHttpConfig$outboundSchema.parse(triggerHttpConfig)); } 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 = z.union([ z.string(), z.number(), z.boolean(), z.record(z.any()), z.array(z.any()), ]); /** @internal */ export const DefaultValue$outboundSchema = z.union([ z.string(), z.number(), z.boolean(), z.record(z.any()), z.array(z.any()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var DefaultValue$; (function (DefaultValue$) { /** @deprecated use `DefaultValue$inboundSchema` instead. */ DefaultValue$.inboundSchema = DefaultValue$inboundSchema; /** @deprecated use `DefaultValue$outboundSchema` instead. */ DefaultValue$.outboundSchema = DefaultValue$outboundSchema; })(DefaultValue$ || (DefaultValue$ = {})); export function defaultValueToJSON(defaultValue) { return JSON.stringify(DefaultValue$outboundSchema.parse(defaultValue)); } 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: z.string().optional(), field_data_type: z.string().optional(), default_value: z.union([ z.string(), z.number(), z.boolean(), z.record(z.any()), z.array(z.any()), ]).optional(), }).transform((v) => { return remap$(v, { "field_name": "fieldName", "field_data_type": "fieldDataType", "default_value": "defaultValue", }); }); /** @internal */ export const TriggerInputSchema$outboundSchema = z.object({ fieldName: z.string().optional(), fieldDataType: z.string().optional(), defaultValue: z.union([ z.string(), z.number(), z.boolean(), z.record(z.any()), z.array(z.any()), ]).optional(), }).transform((v) => { return remap$(v, { fieldName: "field_name", fieldDataType: "field_data_type", defaultValue: "default_value", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var TriggerInputSchema$; (function (TriggerInputSchema$) { /** @deprecated use `TriggerInputSchema$inboundSchema` instead. */ TriggerInputSchema$.inboundSchema = TriggerInputSchema$inboundSchema; /** @deprecated use `TriggerInputSchema$outboundSchema` instead. */ TriggerInputSchema$.outboundSchema = TriggerInputSchema$outboundSchema; })(TriggerInputSchema$ || (TriggerInputSchema$ = {})); export function triggerInputSchemaToJSON(triggerInputSchema) { return JSON.stringify(TriggerInputSchema$outboundSchema.parse(triggerInputSchema)); } export function triggerInputSchemaFromJSON(jsonString) { return safeParse(jsonString, (x) => TriggerInputSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TriggerInputSchema' from JSON`); } /** @internal */ export const WorkflowTriggerRequirementsSuccess$inboundSchema = z.object({ trigger_id: z.string().optional(), trigger_event_type: TriggerEventType$inboundSchema.optional(), trigger_http_config: z.lazy(() => TriggerHttpConfig$inboundSchema).optional(), trigger_input_schema: z.array(z.lazy(() => TriggerInputSchema$inboundSchema)) .optional(), metadata: ResourceMetadata$inboundSchema.optional(), page_limit: z.nullable(z.number().int()).optional(), page_token_next: z.nullable(z.string()).optional(), request_id: z.nullable(z.string()).optional(), response_timestamp: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(), response_duration_ms: z.nullable(z.number().int()).optional(), }).transform((v) => { return remap$(v, { "trigger_id": "triggerId", "trigger_event_type": "triggerEventType", "trigger_http_config": "triggerHttpConfig", "trigger_input_schema": "triggerInputSchema", "page_limit": "pageLimit", "page_token_next": "pageTokenNext", "request_id": "requestId", "response_timestamp": "responseTimestamp", "response_duration_ms": "responseDurationMs", }); }); /** @internal */ export const WorkflowTriggerRequirementsSuccess$outboundSchema = z.object({ triggerId: z.string().optional(), triggerEventType: TriggerEventType$outboundSchema.optional(), triggerHttpConfig: z.lazy(() => TriggerHttpConfig$outboundSchema).optional(), triggerInputSchema: z.array(z.lazy(() => TriggerInputSchema$outboundSchema)) .optional(), metadata: ResourceMetadata$outboundSchema.optional(), pageLimit: z.nullable(z.number().int()).optional(), pageTokenNext: z.nullable(z.string()).optional(), requestId: z.nullable(z.string()).optional(), responseTimestamp: z.nullable(z.date().transform(v => v.toISOString())) .optional(), responseDurationMs: z.nullable(z.number().int()).optional(), }).transform((v) => { return remap$(v, { triggerId: "trigger_id", triggerEventType: "trigger_event_type", triggerHttpConfig: "trigger_http_config", triggerInputSchema: "trigger_input_schema", pageLimit: "page_limit", pageTokenNext: "page_token_next", requestId: "request_id", responseTimestamp: "response_timestamp", responseDurationMs: "response_duration_ms", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var WorkflowTriggerRequirementsSuccess$; (function (WorkflowTriggerRequirementsSuccess$) { /** @deprecated use `WorkflowTriggerRequirementsSuccess$inboundSchema` instead. */ WorkflowTriggerRequirementsSuccess$.inboundSchema = WorkflowTriggerRequirementsSuccess$inboundSchema; /** @deprecated use `WorkflowTriggerRequirementsSuccess$outboundSchema` instead. */ WorkflowTriggerRequirementsSuccess$.outboundSchema = WorkflowTriggerRequirementsSuccess$outboundSchema; })(WorkflowTriggerRequirementsSuccess$ || (WorkflowTriggerRequirementsSuccess$ = {})); export function workflowTriggerRequirementsSuccessToJSON(workflowTriggerRequirementsSuccess) { return JSON.stringify(WorkflowTriggerRequirementsSuccess$outboundSchema.parse(workflowTriggerRequirementsSuccess)); } export function workflowTriggerRequirementsSuccessFromJSON(jsonString) { return safeParse(jsonString, (x) => WorkflowTriggerRequirementsSuccess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowTriggerRequirementsSuccess' from JSON`); } //# sourceMappingURL=workflowtriggerrequirementssuccess.js.map