def set_conditions(self, trigger_id, conditions, trigger_mode=None):
        """
        Set the conditions for the trigger.

        This sets the conditions for all trigger modes, replacing existing conditions for all trigger modes.

        :param trigger_id: The relevant Trigger definition id
        :param trigger_mode: Optional Trigger mode
        :param conditions: Collection of Conditions to set.
        :type trigger_mode: TriggerMode
        :type conditions: List of Condition
        :return: The new conditions.
        """
        data = self._serialize_object(conditions)
        if trigger_mode is not None:
            url = self._service_url(['triggers', trigger_id, 'conditions', trigger_mode])
        else:
            url = self._service_url(['triggers', trigger_id, 'conditions'])

        response = self._put(url, data)
        return Condition.list_to_object_list(response)
Set the conditions for the trigger.

        This sets the conditions for all trigger modes, replacing existing conditions for all trigger modes.

        :param trigger_id: The relevant Trigger definition id
        :param trigger_mode: Optional Trigger mode
        :param conditions: Collection of Conditions to set.
        :type trigger_mode: TriggerMode
        :type conditions: List of Condition
        :return: The new conditions.