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

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";

export type ConnectorGetAuthUrlV1Request = {
  appReturnUrl?: string | null | undefined;
  credentialsName?: string | null | undefined;
  connectorIdOrName: string;
};

/** @internal */
export type ConnectorGetAuthUrlV1Request$Outbound = {
  app_return_url?: string | null | undefined;
  credentials_name?: string | null | undefined;
  connector_id_or_name: string;
};

/** @internal */
export const ConnectorGetAuthUrlV1Request$outboundSchema: z.ZodType<
  ConnectorGetAuthUrlV1Request$Outbound,
  ConnectorGetAuthUrlV1Request
> = z.object({
  appReturnUrl: z.nullable(z.string()).optional(),
  credentialsName: z.nullable(z.string()).optional(),
  connectorIdOrName: z.string(),
}).transform((v) => {
  return remap$(v, {
    appReturnUrl: "app_return_url",
    credentialsName: "credentials_name",
    connectorIdOrName: "connector_id_or_name",
  });
});

export function connectorGetAuthUrlV1RequestToJSON(
  connectorGetAuthUrlV1Request: ConnectorGetAuthUrlV1Request,
): string {
  return JSON.stringify(
    ConnectorGetAuthUrlV1Request$outboundSchema.parse(
      connectorGetAuthUrlV1Request,
    ),
  );
}
