@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
86 lines • 4.25 kB
JavaScript
/*
* 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";
export const Flow = {
Confidential: "confidential",
};
/**
* The grant type. This value must be set to "authorization_code".
*/
export const ConfidentialAuthCodeGrantRequestBodyGrantType = {
AuthorizationCode: "authorization_code",
};
/** @internal */
export const Flow$inboundSchema = z.nativeEnum(Flow);
/** @internal */
export const Flow$outboundSchema = Flow$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var Flow$;
(function (Flow$) {
/** @deprecated use `Flow$inboundSchema` instead. */
Flow$.inboundSchema = Flow$inboundSchema;
/** @deprecated use `Flow$outboundSchema` instead. */
Flow$.outboundSchema = Flow$outboundSchema;
})(Flow$ || (Flow$ = {}));
/** @internal */
export const ConfidentialAuthCodeGrantRequestBodyGrantType$inboundSchema = z
.nativeEnum(ConfidentialAuthCodeGrantRequestBodyGrantType);
/** @internal */
export const ConfidentialAuthCodeGrantRequestBodyGrantType$outboundSchema = ConfidentialAuthCodeGrantRequestBodyGrantType$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var ConfidentialAuthCodeGrantRequestBodyGrantType$;
(function (ConfidentialAuthCodeGrantRequestBodyGrantType$) {
/** @deprecated use `ConfidentialAuthCodeGrantRequestBodyGrantType$inboundSchema` instead. */
ConfidentialAuthCodeGrantRequestBodyGrantType$.inboundSchema = ConfidentialAuthCodeGrantRequestBodyGrantType$inboundSchema;
/** @deprecated use `ConfidentialAuthCodeGrantRequestBodyGrantType$outboundSchema` instead. */
ConfidentialAuthCodeGrantRequestBodyGrantType$.outboundSchema = ConfidentialAuthCodeGrantRequestBodyGrantType$outboundSchema;
})(ConfidentialAuthCodeGrantRequestBodyGrantType$ || (ConfidentialAuthCodeGrantRequestBodyGrantType$ = {}));
/** @internal */
export const ConfidentialAuthCodeGrantRequestBody$inboundSchema = z.object({
flow: z.literal("confidential").default("confidential").optional(),
grant_type: ConfidentialAuthCodeGrantRequestBodyGrantType$inboundSchema
.default("authorization_code"),
code: z.string(),
}).transform((v) => {
return remap$(v, {
"grant_type": "grantType",
});
});
/** @internal */
export const ConfidentialAuthCodeGrantRequestBody$outboundSchema = z.object({
flow: z.literal("confidential").default("confidential"),
grantType: ConfidentialAuthCodeGrantRequestBodyGrantType$outboundSchema
.default("authorization_code"),
code: z.string(),
}).transform((v) => {
return remap$(v, {
grantType: "grant_type",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var ConfidentialAuthCodeGrantRequestBody$;
(function (ConfidentialAuthCodeGrantRequestBody$) {
/** @deprecated use `ConfidentialAuthCodeGrantRequestBody$inboundSchema` instead. */
ConfidentialAuthCodeGrantRequestBody$.inboundSchema = ConfidentialAuthCodeGrantRequestBody$inboundSchema;
/** @deprecated use `ConfidentialAuthCodeGrantRequestBody$outboundSchema` instead. */
ConfidentialAuthCodeGrantRequestBody$.outboundSchema = ConfidentialAuthCodeGrantRequestBody$outboundSchema;
})(ConfidentialAuthCodeGrantRequestBody$ || (ConfidentialAuthCodeGrantRequestBody$ = {}));
export function confidentialAuthCodeGrantRequestBodyToJSON(confidentialAuthCodeGrantRequestBody) {
return JSON.stringify(ConfidentialAuthCodeGrantRequestBody$outboundSchema.parse(confidentialAuthCodeGrantRequestBody));
}
export function confidentialAuthCodeGrantRequestBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => ConfidentialAuthCodeGrantRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfidentialAuthCodeGrantRequestBody' from JSON`);
}
//# sourceMappingURL=confidentialauthcodegrantrequestbody.js.map