UNPKG

buena-typescript-sdk

Version:

Official TypeScript SDK for Buena.ai API - LinkedIn automation and lead management

77 lines (68 loc) 2.18 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreateApiKeyRequest = { /** * Name for the API key */ name?: string | undefined; /** * List of permissions for the key */ permissions?: Array<string> | undefined; }; /** @internal */ export const CreateApiKeyRequest$inboundSchema: z.ZodType< CreateApiKeyRequest, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), permissions: z.array(z.string()).optional(), }); /** @internal */ export type CreateApiKeyRequest$Outbound = { name?: string | undefined; permissions?: Array<string> | undefined; }; /** @internal */ export const CreateApiKeyRequest$outboundSchema: z.ZodType< CreateApiKeyRequest$Outbound, z.ZodTypeDef, CreateApiKeyRequest > = z.object({ name: z.string().optional(), permissions: z.array(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 namespace CreateApiKeyRequest$ { /** @deprecated use `CreateApiKeyRequest$inboundSchema` instead. */ export const inboundSchema = CreateApiKeyRequest$inboundSchema; /** @deprecated use `CreateApiKeyRequest$outboundSchema` instead. */ export const outboundSchema = CreateApiKeyRequest$outboundSchema; /** @deprecated use `CreateApiKeyRequest$Outbound` instead. */ export type Outbound = CreateApiKeyRequest$Outbound; } export function createApiKeyRequestToJSON( createApiKeyRequest: CreateApiKeyRequest, ): string { return JSON.stringify( CreateApiKeyRequest$outboundSchema.parse(createApiKeyRequest), ); } export function createApiKeyRequestFromJSON( jsonString: string, ): SafeParseResult<CreateApiKeyRequest, SDKValidationError> { return safeParse( jsonString, (x) => CreateApiKeyRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateApiKeyRequest' from JSON`, ); }