def METHOD_NAME(self, mode, maintenance_duration, user):
    from apps.alerts.models import Alert, AlertGroup, AlertReceiveChannel
    with transaction.atomic():
        _self = self.__class__.objects.select_for_update().get(pk=self.pk)
        if _self.maintenance_mode is not None:
            raise MaintenanceCouldNotBeStartedError("Already on maintenance")
        organization = _self.get_organization()
        team = _self.get_team()
        verbal = _self.get_verbal()
        user_verbal = user.get_username_with_slack_verbal()
        duration_verbal = humanize.naturaldelta(maintenance_duration)
        # NOTE: there could be multiple maintenance integrations in case of a race condition
        # (no constraints at the db level, it shouldn't be an issue functionality-wise)
        maintenance_integration = AlertReceiveChannel.objects_with_maintenance.filter(
            organization=organization,
            team=team,
            integration=AlertReceiveChannel.INTEGRATION_MAINTENANCE,
        ).last()
        if maintenance_integration is None:
            maintenance_integration = AlertReceiveChannel.create(
                organization=organization,
                team=team,
                integration=AlertReceiveChannel.INTEGRATION_MAINTENANCE,
                author=user,
            )
        maintenance_uuid = _self.start_disable_maintenance_task(maintenance_duration)
        _self.maintenance_duration = datetime.timedelta(seconds=maintenance_duration)
        _self.maintenance_uuid = maintenance_uuid
        _self.maintenance_mode = mode
        _self.maintenance_started_at = timezone.now()
        _self.maintenance_author = user
        _self.save(
            update_fields=[
                "maintenance_duration",
                "maintenance_uuid",
                "maintenance_mode",
                "maintenance_started_at",
                "maintenance_author",
            ]
        )
        self.maintenance_duration = _self.maintenance_duration
        self.maintenance_uuid = _self.maintenance_uuid
        self.maintenance_mode = _self.maintenance_mode
        self.maintenance_started_at = _self.maintenance_started_at
        self.maintenance_author = _self.maintenance_author
        if mode == AlertReceiveChannel.MAINTENANCE:
            group = AlertGroup.objects.create(
                distinction=uuid4(),
                web_title_cache=f"Maintenance of {verbal} for {maintenance_duration}",
                maintenance_uuid=maintenance_uuid,
                channel_filter_id=maintenance_integration.default_channel_filter.pk,
                channel=maintenance_integration,
            )
            title = f"Maintenance of {verbal} for {duration_verbal}"
            message = (
                f"Initiated by {user_verbal}."
                f" During this time all alerts from integration will be collected here without escalations"
            )
            alert = Alert(
                is_the_first_alert_in_group=True,
                is_resolve_signal=False,
                title=title,
                message=message,
                group=group,
                raw_request_data={
                    "title": title,
                    "message": message,
                },
            )
            alert.save()
    write_maintenance_insight_log(self, user, MaintenanceEvent.STARTED)
    if mode == AlertReceiveChannel.MAINTENANCE:
        self.notify_about_maintenance_action(
            f"Maintenance of {verbal}. Initiated by {user_verbal} for {duration_verbal}.",
            send_to_general_log_channel=False,
        )
    else:
        self.notify_about_maintenance_action(
            f"Debug of {verbal}. Initiated by {user_verbal} for {duration_verbal}."
        )