export type CreateApiV1IncidentsSecretsIncidentIdUnshareArgs = {incident_id: number}; export type CreateApiV1IncidentsSecretsIncidentIdUnshareOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unshare a secret incident * * POST /v1/incidents/secrets/{incident_id}/unshare */ export const createApiV1IncidentsSecretsIncidentIdUnshare = async (args: CreateApiV1IncidentsSecretsIncidentIdUnshareArgs, options?: CreateApiV1IncidentsSecretsIncidentIdUnshareOptions) => { const {baseUrl = "https://api.gitguardian.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set('authorization', `Bearer ${apiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/incidents/secrets/${encodeURIComponent(String(args.incident_id))}/unshare${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };