UNPKG

@docusign/iam-sdk

Version:

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

52 lines 2.22 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"; /** @internal */ export const AuthorizationCodeGrantResponse$inboundSchema = z.object({ access_token: z.string(), token_type: z.string(), refresh_token: z.string(), expires_in: z.number().int(), }).transform((v) => { return remap$(v, { "access_token": "accessToken", "token_type": "tokenType", "refresh_token": "refreshToken", "expires_in": "expiresIn", }); }); /** @internal */ export const AuthorizationCodeGrantResponse$outboundSchema = z.object({ accessToken: z.string(), tokenType: z.string(), refreshToken: z.string(), expiresIn: z.number().int(), }).transform((v) => { return remap$(v, { accessToken: "access_token", tokenType: "token_type", refreshToken: "refresh_token", expiresIn: "expires_in", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var AuthorizationCodeGrantResponse$; (function (AuthorizationCodeGrantResponse$) { /** @deprecated use `AuthorizationCodeGrantResponse$inboundSchema` instead. */ AuthorizationCodeGrantResponse$.inboundSchema = AuthorizationCodeGrantResponse$inboundSchema; /** @deprecated use `AuthorizationCodeGrantResponse$outboundSchema` instead. */ AuthorizationCodeGrantResponse$.outboundSchema = AuthorizationCodeGrantResponse$outboundSchema; })(AuthorizationCodeGrantResponse$ || (AuthorizationCodeGrantResponse$ = {})); export function authorizationCodeGrantResponseToJSON(authorizationCodeGrantResponse) { return JSON.stringify(AuthorizationCodeGrantResponse$outboundSchema.parse(authorizationCodeGrantResponse)); } export function authorizationCodeGrantResponseFromJSON(jsonString) { return safeParse(jsonString, (x) => AuthorizationCodeGrantResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthorizationCodeGrantResponse' from JSON`); } //# sourceMappingURL=authorizationcodegrantresponse.js.map