input: Write a function to generate a basic REST API with authentication and endpoints in Python. The API should include a JWT authentication setup, items resource, and item lists resource. Ensure that the items resource has GET and POST endpoints, and the item lists resource has a GET endpoint. If the API is generated successfully, return True, otherwise return False.
  assert generate_rest_api()==True
  assert generate_rest_api()==True
  assert generate_rest_api()==True
  assert generate_rest_api()==True
  assert generate_rest_api()==True
output: 
  def generate_rest_api():
      try:
          from flask import Flask, request, jsonify
          from flask_jwt_extended import JWTManager, jwt_required, create_access_token
          from flask_restful import Api, Resource
  
          app = Flask(__name__)
          app.config['JWT_SECRET_KEY'] = 'super-secret'
          jwt = JWTManager(app)
          api = Api(app)
  
          class ItemsResource(Resource):
              @jwt_required()
              def get(self):
                  return jsonify({"message": "GET items"})
  
              @jwt_required()
              def post(self):
                  return jsonify({"message": "POST item"})
  
          class ItemListsResource(Resource):
              @jwt_required()
              def get(self):
                  return jsonify({"message": "GET item lists"})
  
          api.add_resource(ItemsResource, '/items')
          api.add_resource(ItemListsResource, '/item-lists')
  
          @app.route('/login', methods=['POST'])
          def login():
              username = request.json.get('username', None)
              password = request.json.get('password', None)
              if username != 'test' or password != 'test':
                  return jsonify({"msg": "Bad username or password"}), 401
              access_token = create_access_token(identity=username)
              return jsonify(access_token=access_token)
  
          return True
      except Exception as e:
          return False
  