google sheets – What is the updated method of "CalendarApp.openByName"

We use a calendar of events that we use in the context of Google Maps, our script uses the method "CalendarApp.openByName" to add the name automatically inside a Cell. It says the method is obsolete, what is the updated name for this method?

Here is the complete script:

var EVENT_IMPORTED = "ADDED"; // Add the text "ADDED" in column N
var ss = SpreadsheetApp.getActiveSpreadsheet ();

function onOpen () {
   var menuEntries = [{name: "Ajouter les événements à l'agenda", functionName: "importCalendar"}];
   ss.addMenu ("Agenda", menuEntries); // To add an Agenda menu and a submenu "add events" in the spreadsheet. This will manually test the link between the spreadsheet and the calendar
}

function importCalendar () {
    var sheet = SpreadsheetApp.getActiveSheet ();
    var startcolumn = 2; // First column of data entry, column B (appointment title)
    var numcolumns = 30; // Number of columns
    var dataRange = sheet.getRange (startcolumn, 1, numcolumns, 11) // Number of columns containing data
    var data = dataRange.getValues ​​();
  for (var i = 0; i <data.length; ++ i) {
    var column = data[i];
    var title = column[1]; // Column B - Event title in the calendar - Appointment title
    var StartDate = column[2]; // Column C - start date and time of the event
    var Name = column[3]; // Column E - Contact Name
    var Address = column[4]; // Column F - Address
    var CP = column[5]; // Column G - Postal Code
    var City = column[6]; // Column H - City
    var NumTel = column[7]; // Column I - Telephone number
    var Location = column[8];
    var Mail = column[9]; // Column J - Beginning

    var description = "Contact Name:" + Name + "// Address:" + Address + "// Postal code:" + CP + "// City:" + City + "// Telephone number:" + NumTel + "// Location Activity:" + Location // concatenation of the fields of columns E to K for the area Description of the agenda
    var eventImported = column[11]; // Column N - Import Status - column ADDED TO AGENDA


    var setupInfo = ss.getSheetByName ("agenda"); // Name of the spreadsheet containing the name of the calendar
    var calendarName = setupInfo.getRange ("A1"). getValue (); // Cell reference containing the name of the calendar


    if (eventImported! = EVENT_IMPORTED && title! = "") {// Avoid duplicates in the calendar, if the text ADD is present in K, the event is not added
    var cal = CalendarApp.openByName (calendarName);


     cal.createEvent (title, new Date, new Date, {description: description}); // Create the event in the calendar with title, start date, end date and full description


      sheet.getRange (startcolumn + i, 11) .setValue (EVENT_IMPORTED); // Number of columns containing data

      SpreadsheetApp.flush ();
    }
  }
}