export type CreateApiDrivesDriveIdItemsDriveItemIdMicrosoftGraphDiscardCheckoutArgs = {driveId: string, driveItemId: string}; export type CreateApiDrivesDriveIdItemsDriveItemIdMicrosoftGraphDiscardCheckoutOptions = {baseUrl?: string | undefined, azureaadv2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Invoke action discardCheckout * * POST /drives/{driveId}/items/{driveItemId}/microsoft.graph.discardCheckout */ export const createApiDrivesDriveIdItemsDriveItemIdMicrosoftGraphDiscardCheckout = async (args: CreateApiDrivesDriveIdItemsDriveItemIdMicrosoftGraphDiscardCheckoutArgs, options?: CreateApiDrivesDriveIdItemsDriveItemIdMicrosoftGraphDiscardCheckoutOptions) => { const {baseUrl = "https://graph.microsoft.com/v1.0", fetch: fetchFn = fetch, azureaadv2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (azureaadv2 !== undefined) headers.set('authorization', `Bearer ${azureaadv2}`) const url = `${baseUrl.replace(/\/+$/, '')}/drives/${encodeURIComponent(String(args.driveId))}/items/${encodeURIComponent(String(args.driveItemId))}/microsoft.graph.discardCheckout${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 };