@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
97 lines • 3.72 kB
TypeScript
import * as z from "zod/v3";
import { ClosedEnum } from "../../types/enums.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
/**
* The http method to use when invoking this affordance
*/
export declare const AffordanceMethod: {
readonly Post: "POST";
readonly Get: "GET";
readonly Patch: "PATCH";
readonly Put: "PUT";
readonly Delete: "DELETE";
};
/**
* The http method to use when invoking this affordance
*/
export type AffordanceMethod = ClosedEnum<typeof AffordanceMethod>;
/**
* Affordances (aka 'actions') describe the available operations on a resource, including CRUD and RPC-like operations. It details the
*
* @remarks
* expected input payload, http method, query parameters, and the resulting output.
*
* Affordances enable clients to dynamically adapt to the API's current state and available actions. Instead of
* hardcoding all possible endpoints and their associated logic, a client can inspect the affordances within a
* resource's representation to discover what actions are possible and how to perform them.
*/
export type Affordance = {
href?: string | null | undefined;
/**
* The http method to use when invoking this affordance
*/
method?: AffordanceMethod | undefined;
/**
* Indicates if an action must be performed on a resource. This may include a manadatory step as part of a business process, especially
*
* @remarks
* when failing to execute a subsequent action will leave the resource in a bad or incomplete state.
* # note: would it be necessary for manadatory/required actionsto be performed prior to an optional action
* # note: mandatory actions which have previously been executed on a resource should not be be returned in the server response
* # execept in cases where the resource is in a state that permits this action to be performed again.
*/
required: boolean;
/**
* Provides a stable and consistent order to a collection of resources. Useful when multiple processes are working in parallel to iterate over
*
* @remarks
* a collection of resources with a mandatory/required action.
*/
sequence?: number | undefined;
/**
* Placeholder
*/
description?: string | undefined;
/**
* A natural language dictionary of JSON template variables used in invoke an action
*
* @remarks
*/
templateVariables?: {
[k: string]: string;
} | undefined;
/**
* Additional HTTP request headers needed in the request to invoke an action.
*
* @remarks
*/
headers?: {
[k: string]: string;
} | undefined;
/**
* Limits and restrictions on
*
* @remarks
*/
constraints?: any | undefined;
/**
* Success status codes (2xx range) indicating the request was received,
*
* @remarks
* understood, and accepted.
* Common codes:
* - 200: OK - Standard successful response
* - 201: Created - Resource successfully created
* - 202: Accepted - Request accepted for processing
* - 204: No Content - Successful with no response body
* - 206: Partial Content - Partial resource returned
*/
successStatusCode?: number | undefined;
};
/** @internal */
export declare const AffordanceMethod$inboundSchema: z.ZodNativeEnum<typeof AffordanceMethod>;
/** @internal */
export declare const Affordance$inboundSchema: z.ZodType<Affordance, z.ZodTypeDef, unknown>;
export declare function affordanceFromJSON(jsonString: string): SafeParseResult<Affordance, SDKValidationError>;
//# sourceMappingURL=affordance.d.ts.map