@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.
81 lines (75 loc) • 2.02 kB
text/typescript
/*
* 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 { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
Link,
Link$inboundSchema,
Link$Outbound,
Link$outboundSchema,
} from "./link.js";
export type ParentResourceRep = {
links?: { [k: string]: Link } | undefined;
/**
* The name of the parent resource
*/
name?: string | undefined;
/**
* The parent's resource specifier
*/
resource?: string | undefined;
};
/** @internal */
export const ParentResourceRep$inboundSchema: z.ZodType<
ParentResourceRep,
z.ZodTypeDef,
unknown
> = z.object({
_links: z.record(Link$inboundSchema).optional(),
name: z.string().optional(),
resource: z.string().optional(),
}).transform((v) => {
return remap$(v, {
"_links": "links",
});
});
/** @internal */
export type ParentResourceRep$Outbound = {
_links?: { [k: string]: Link$Outbound } | undefined;
name?: string | undefined;
resource?: string | undefined;
};
/** @internal */
export const ParentResourceRep$outboundSchema: z.ZodType<
ParentResourceRep$Outbound,
z.ZodTypeDef,
ParentResourceRep
> = z.object({
links: z.record(Link$outboundSchema).optional(),
name: z.string().optional(),
resource: z.string().optional(),
}).transform((v) => {
return remap$(v, {
links: "_links",
});
});
export function parentResourceRepToJSON(
parentResourceRep: ParentResourceRep,
): string {
return JSON.stringify(
ParentResourceRep$outboundSchema.parse(parentResourceRep),
);
}
export function parentResourceRepFromJSON(
jsonString: string,
): SafeParseResult<ParentResourceRep, SDKValidationError> {
return safeParse(
jsonString,
(x) => ParentResourceRep$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'ParentResourceRep' from JSON`,
);
}