/*
* 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 GetRepositoriesRequest = {
/**
* If set to any value, the endpoint returns repositories with associated branch data
*/
withBranches?: string | undefined;
/**
* If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch
*/
withReferencesForDefaultBranch?: string | undefined;
/**
* A LaunchDarkly project key. If provided, this filters code reference results to the specified project.
*/
projKey?: string | undefined;
/**
* If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch
*/
flagKey?: string | undefined;
};
/** @internal */
export const GetRepositoriesRequest$inboundSchema: z.ZodType<
GetRepositoriesRequest,
z.ZodTypeDef,
unknown
> = z.object({
withBranches: z.string().optional(),
withReferencesForDefaultBranch: z.string().optional(),
projKey: z.string().optional(),
flagKey: z.string().optional(),
});
/** @internal */
export type GetRepositoriesRequest$Outbound = {
withBranches?: string | undefined;
withReferencesForDefaultBranch?: string | undefined;
projKey?: string | undefined;
flagKey?: string | undefined;
};
/** @internal */
export const GetRepositoriesRequest$outboundSchema: z.ZodType<
GetRepositoriesRequest$Outbound,
z.ZodTypeDef,
GetRepositoriesRequest
> = z.object({
withBranches: z.string().optional(),
withReferencesForDefaultBranch: z.string().optional(),
projKey: z.string().optional(),
flagKey: 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 GetRepositoriesRequest$ {
/** @deprecated use `GetRepositoriesRequest$inboundSchema` instead. */
export const inboundSchema = GetRepositoriesRequest$inboundSchema;
/** @deprecated use `GetRepositoriesRequest$outboundSchema` instead. */
export const outboundSchema = GetRepositoriesRequest$outboundSchema;
/** @deprecated use `GetRepositoriesRequest$Outbound` instead. */
export type Outbound = GetRepositoriesRequest$Outbound;
}
export function getRepositoriesRequestToJSON(
getRepositoriesRequest: GetRepositoriesRequest,
): string {
return JSON.stringify(
GetRepositoriesRequest$outboundSchema.parse(getRepositoriesRequest),
);
}
export function getRepositoriesRequestFromJSON(
jsonString: string,
): SafeParseResult<GetRepositoriesRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetRepositoriesRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetRepositoriesRequest' from JSON`,
);
}