export type DeleteApiMeMailFoldersMailFolderIdChildFoldersMailFolderId1Args = {'If-Match'?: string | undefined}; export type DeleteApiMeMailFoldersMailFolderIdChildFoldersMailFolderId1Options = {baseUrl?: string | undefined, azureOAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete child folder * * DELETE /me/mailFolders/{mailFolderId}/childFolders/{mailFolderId1} */ export const deleteApiMeMailFoldersMailFolderIdChildFoldersMailFolderId1 = async (args: DeleteApiMeMailFoldersMailFolderIdChildFoldersMailFolderId1Args, options?: DeleteApiMeMailFoldersMailFolderIdChildFoldersMailFolderId1Options) => { const {baseUrl = "https://graph.microsoft.com/v1.0", fetch: fetchFn = fetch, azureOAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['If-Match'] != null) headers.set("If-Match", String(args['If-Match'])) if (azureOAuth2 !== undefined) headers.set('authorization', `Bearer ${azureOAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/me/mailFolders/${encodeURIComponent(String(args.mailFolderId))}/childFolders/${encodeURIComponent(String(args.mailFolderId1))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };