input: def create_rest_api_with_flask() -> None:
      """
      Generate a REST API with Python and Flask that allows users to create, read, update, and delete records from a database.
      
      Example:
      When the Flask application is running, a user can create a record by sending a POST request to '/records' with a JSON body containing the 'name' field. The application will respond with a JSON containing the 'id' of the newly created record.
      """
output:     
      from flask import Flask, request, jsonify
      from flask_sqlalchemy import SQLAlchemy
  
      app = Flask(__name__)
      app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///records.db'
      db = SQLAlchemy(app)
  
      class Record(db.Model):
          id = db.Column(db.Integer, primary_key=True)
          name = db.Column(db.String(80), nullable=False)
  
          def __repr__(self):
              return f'<Record {self.name}>'
  
      @app.route('/records', methods=['POST'])
      def create_record():
          data = request.get_json()
          new_record = Record(name=data['name'])
          db.session.add(new_record)
          db.session.commit()
          return jsonify({'id': new_record.id}), 201
  
      @app.route('/records', methods=['GET'])
      def get_records():
          records = Record.query.all()
          return jsonify([{'id': record.id, 'name': record.name} for record in records])
  
      @app.route('/records/<int:id>', methods=['GET'])
      def get_record(id):
          record = Record.query.get_or_404(id)
          return jsonify({'id': record.id, 'name': record.name})
  
      @app.route('/records/<int:id>', methods=['PUT'])
      def update_record(id):
          record = Record.query.get_or_404(id)
          data = request.get_json()
          record.name = data['name']
          db.session.commit()
          return jsonify({'id': record.id, 'name': record.name})
  
      @app.route('/records/<int:id>', methods=['DELETE'])
      def delete_record(id):
          record = Record.query.get_or_404(id)
          db.session.delete(record)
          db.session.commit()
          return jsonify({'result': True})
  
      if __name__ == '__main__':
          db.create_all()
          app.run(debug=True)
  