@launchdarkly/mcp-server
Version:
The local [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [LaunchDarkly](https://launchdarkly.com/) federal and European Union (EU) environments.
62 lines (56 loc) • 1.57 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
AccessAllowedReason,
AccessAllowedReason$inboundSchema,
AccessAllowedReason$Outbound,
AccessAllowedReason$outboundSchema,
} from "./accessallowedreason.js";
export type AccessAllowedRep = {
action: string;
reason: AccessAllowedReason;
};
/** @internal */
export const AccessAllowedRep$inboundSchema: z.ZodType<
AccessAllowedRep,
z.ZodTypeDef,
unknown
> = z.object({
action: z.string(),
reason: AccessAllowedReason$inboundSchema,
});
/** @internal */
export type AccessAllowedRep$Outbound = {
action: string;
reason: AccessAllowedReason$Outbound;
};
/** @internal */
export const AccessAllowedRep$outboundSchema: z.ZodType<
AccessAllowedRep$Outbound,
z.ZodTypeDef,
AccessAllowedRep
> = z.object({
action: z.string(),
reason: AccessAllowedReason$outboundSchema,
});
export function accessAllowedRepToJSON(
accessAllowedRep: AccessAllowedRep,
): string {
return JSON.stringify(
AccessAllowedRep$outboundSchema.parse(accessAllowedRep),
);
}
export function accessAllowedRepFromJSON(
jsonString: string,
): SafeParseResult<AccessAllowedRep, SDKValidationError> {
return safeParse(
jsonString,
(x) => AccessAllowedRep$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'AccessAllowedRep' from JSON`,
);
}