export type GetApiV2EnvIdFlowIdTenantLinkedConnectorsDiscoverArgs = {env_id: string, flow_id: string, tenant: string, connector_id: string, v2_source?: boolean | undefined}; export type GetApiV2EnvIdFlowIdTenantLinkedConnectorsDiscoverOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Run Discover * * GET /v2/{env_id}/{flow_id}/{tenant}/linkedConnectors/discover */ export const getApiV2EnvIdFlowIdTenantLinkedConnectorsDiscover = async (args: GetApiV2EnvIdFlowIdTenantLinkedConnectorsDiscoverArgs, options?: GetApiV2EnvIdFlowIdTenantLinkedConnectorsDiscoverOptions) => { const {baseUrl = "https://api.hotglue.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.connector_id != null) query.append("connector_id", String(args.connector_id)) if (args.v2_source != null) query.append("v2_source", String(args.v2_source)) if (sec0 !== undefined) headers.set("x-api-key", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/v2/${encodeURIComponent(String(args.env_id))}/${encodeURIComponent(String(args.flow_id))}/${encodeURIComponent(String(args.tenant))}/linkedConnectors/discover${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };