import { useMutation, useQueryClient, } from '@tanstack/react-query';
import { NullSeamClientError, useSeamClient } from '../../../../lib/seam/use-seam-client.js';
export function useDeleteClimateSettingSchedule() {
    const { client } = useSeamClient();
    const queryClient = useQueryClient();
    return useMutation({
        mutationFn: async (mutationParams) => {
            if (client === null)
                throw new NullSeamClientError();
            await client.thermostats.climateSettingSchedules.delete(mutationParams);
        },
        onSuccess: (_data, variables) => {
            void queryClient.invalidateQueries([
                'thermostats',
                'climate_setting_schedules',
                'get',
                { climate_setting_schedule_id: variables.climate_setting_schedule_id },
            ]);
            void queryClient.invalidateQueries([
                'thermostats',
                'climate_setting_schedules',
                'list',
            ]);
        },
    });
}
//# sourceMappingURL=use-delete-climate-setting-schedule.js.map