@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.
58 lines (52 loc) • 1.44 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";
export type CustomProperty = {
/**
* The name of the custom property of this type.
*/
name: string;
/**
* An array of values for the custom property data to associate with this flag.
*/
value: Array<string>;
};
/** @internal */
export const CustomProperty$inboundSchema: z.ZodType<
CustomProperty,
z.ZodTypeDef,
unknown
> = z.object({
name: z.string(),
value: z.array(z.string()),
});
/** @internal */
export type CustomProperty$Outbound = {
name: string;
value: Array<string>;
};
/** @internal */
export const CustomProperty$outboundSchema: z.ZodType<
CustomProperty$Outbound,
z.ZodTypeDef,
CustomProperty
> = z.object({
name: z.string(),
value: z.array(z.string()),
});
export function customPropertyToJSON(customProperty: CustomProperty): string {
return JSON.stringify(CustomProperty$outboundSchema.parse(customProperty));
}
export function customPropertyFromJSON(
jsonString: string,
): SafeParseResult<CustomProperty, SDKValidationError> {
return safeParse(
jsonString,
(x) => CustomProperty$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'CustomProperty' from JSON`,
);
}