/* * 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"; import * as components from "../components/index.js"; export type ConnectorGetAuthUrlV1Request = { connectorIdOrName: string; appReturnUrl?: string | null | undefined; /** * Auth method type to use for the authorization URL. Required when the connector supports multiple interactive auth methods; otherwise the sole method is selected automatically. Use this to pick a specific method (e.g. 'oauth2' vs 'github_app'). */ methodType?: components.OutboundAuthenticationType | undefined; credentialsName?: string | null | undefined; /** * Only valid with method_type=oauth2. When true, returns a GitHub App installation URL (https://github.com/apps//installations/new) if the connector has the proper configuration The Github application needs to have 'Request user authorization (OAuth) during installation' enabled to perform the proper auth loop. */ githubInstallationLink?: boolean | undefined; }; /** @internal */ export type ConnectorGetAuthUrlV1Request$Outbound = { connector_id_or_name: string; app_return_url?: string | null | undefined; method_type?: string | undefined; credentials_name?: string | null | undefined; github_installation_link: boolean; }; /** @internal */ export const ConnectorGetAuthUrlV1Request$outboundSchema: z.ZodType< ConnectorGetAuthUrlV1Request$Outbound, ConnectorGetAuthUrlV1Request > = z.object({ connectorIdOrName: z.string(), appReturnUrl: z.nullable(z.string()).optional(), methodType: components.OutboundAuthenticationType$outboundSchema.optional(), credentialsName: z.nullable(z.string()).optional(), githubInstallationLink: z.boolean().default(false), }).transform((v) => { return remap$(v, { connectorIdOrName: "connector_id_or_name", appReturnUrl: "app_return_url", methodType: "method_type", credentialsName: "credentials_name", githubInstallationLink: "github_installation_link", }); }); export function connectorGetAuthUrlV1RequestToJSON( connectorGetAuthUrlV1Request: ConnectorGetAuthUrlV1Request, ): string { return JSON.stringify( ConnectorGetAuthUrlV1Request$outboundSchema.parse( connectorGetAuthUrlV1Request, ), ); }