/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";

export type GithubRepositoryIn = {
  type?: "github" | undefined;
  name: string;
  owner: string;
  ref?: string | null | undefined;
  weight?: number | undefined;
  token: string;
};

/** @internal */
export type GithubRepositoryIn$Outbound = {
  type: "github";
  name: string;
  owner: string;
  ref?: string | null | undefined;
  weight: number;
  token: string;
};

/** @internal */
export const GithubRepositoryIn$outboundSchema: z.ZodType<
  GithubRepositoryIn$Outbound,
  z.ZodTypeDef,
  GithubRepositoryIn
> = z.object({
  type: z.literal("github").default("github" as const),
  name: z.string(),
  owner: z.string(),
  ref: z.nullable(z.string()).optional(),
  weight: z.number().default(1),
  token: z.string(),
});

export function githubRepositoryInToJSON(
  githubRepositoryIn: GithubRepositoryIn,
): string {
  return JSON.stringify(
    GithubRepositoryIn$outboundSchema.parse(githubRepositoryIn),
  );
}
