UNPKG

@docusign/iam-sdk

Version:

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

64 lines 2.31 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"; /** @internal */ export const UserInfoLink$inboundSchema = z.object({ rel: types.string(), href: types.string(), }); export function userInfoLinkFromJSON(jsonString) { return safeParse(jsonString, (x) => UserInfoLink$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserInfoLink' from JSON`); } /** @internal */ export const Organization$inboundSchema = z.object({ organization_id: types.string(), links: z.array(z.lazy(() => UserInfoLink$inboundSchema)), }).transform((v) => { return remap$(v, { "organization_id": "organizationId", }); }); export function organizationFromJSON(jsonString) { return safeParse(jsonString, (x) => Organization$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Organization' from JSON`); } /** @internal */ export const Account$inboundSchema = z.object({ account_id: types.string(), is_default: types.boolean(), account_name: types.string(), base_uri: types.string(), organization: types.optional(z.lazy(() => Organization$inboundSchema)), }).transform((v) => { return remap$(v, { "account_id": "accountId", "is_default": "isDefault", "account_name": "accountName", "base_uri": "baseUri", }); }); export function accountFromJSON(jsonString) { return safeParse(jsonString, (x) => Account$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Account' from JSON`); } /** @internal */ export const UserInfo$inboundSchema = z.object({ sub: types.string(), name: types.string(), given_name: types.string(), family_name: types.string(), created: types.string(), email: types.string(), accounts: z.array(z.lazy(() => Account$inboundSchema)), }).transform((v) => { return remap$(v, { "given_name": "givenName", "family_name": "familyName", }); }); export function userInfoFromJSON(jsonString) { return safeParse(jsonString, (x) => UserInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserInfo' from JSON`); } //# sourceMappingURL=userinfo.js.map