title: creating google calendar event
body: <p>am trying to create google calendar event using the following code given below, but am getting class Event not found . How to create a new event. please help</p>
  
  <pre><code>&lt;?php
           require_once '../../src/Google_Client.php';
           require_once '../../src/contrib/Google_CalendarService.php';
           session_start();
  
           $client = new Google_Client();
           $client-&gt;setApplicationName("Google Calendar PHP Starter Application");
  
           $client-&gt;setClientId('');
           $client-&gt;setClientSecret('');
           $client-&gt;setRedirectUri('simple.php');
           $client-&gt;setDeveloperKey('insert_your_developer_key');
           $cal = new Google_CalendarService($client);
           if (isset($_GET['logout'])) {
             unset($_SESSION['token']);
           }
  
           if (isset($_GET['code'])) {
              $client-&gt;authenticate($_GET['code']);
              $_SESSION['token'] = $client-&gt;getAccessToken();
              header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
          }
  
          if (isset($_SESSION['token'])) {
             $client-&gt;setAccessToken($_SESSION['token']);
          }
  
          $authUrl = $client-&gt;createAuthUrl();
  if (!$client-&gt;getAccessToken()) {
  </code></pre>
  
  <blockquote>
    <p>here am creating the new event</p>
  </blockquote>
  
  <pre><code>          $event = new Event();
            $event-&gt;setSummary("test title");
            $event-&gt;setLocation("test location");
            $start = new EventDateTime();
            $start-&gt;setDateTime('04-03-2012 09:25:00:000 -05:00');
            $event-&gt;setStart($start);
            $end = new EventDateTime();
            $end-&gt;setDateTime('04-03-2012 10:25:00:000 -05:00');
  
            $createdEvent = $cal-&gt;events-&gt;insert('primary', $event);
  
            echo $createdEvent-&gt;getId();
  }
  </code></pre>