title: Google Calendar V3 Ruby API insert event
body: <p>I am using example from <a href="https://developers.google.com/google-apps/calendar/v3/reference/events/insert" rel="nofollow noreferrer">https://developers.google.com/google-apps/calendar/v3/reference/events/insert</a></p>
  
  <pre><code>event = Google::Apis::CalendarV3::Event.new{
    summary:'Google I/O 2015',
    location:'800 Howard St., San Francisco, CA 94103',
    description:'A chance to hear more about Google\'s developer products.',
    start: {
      date_time: '2015-05-28T09:00:00-07:00',
      time_zone:'America/Los_Angeles',
    },
    end: {
      date_time:'2015-05-28T17:00:00-07:00',
      time_zone:'America/Los_Angeles',
    }
  }
  
  result = service.insert_event(calendar_id, event)
  </code></pre>
  
  <p>However, I got error:</p>
  
  <pre><code>wwtlf:~/workspace $ ruby test.rb 
  /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/http_command.rb:202:in `check_status': required: Missing end time. (Google::Apis::ClientError)
          from /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/api_command.rb:103:in `check_status'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/http_command.rb:170:in `process_response'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/http_command.rb:275:in `execute_once'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/http_command.rb:107:in `block (2 levels) in execute'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:54:in `block in retriable'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:48:in `times'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:48:in `retriable'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/http_command.rb:104:in `block in execute'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:54:in `block in retriable'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:48:in `times'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:48:in `retriable'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/http_command.rb:96:in `execute'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/base_service.rb:267:in `execute_or_queue_command'
          from /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/generated/google/apis/calendar_v3/service.rb:1207:in `insert_event'
  </code></pre>
  
  <p>What is wrong with event object from example?
  I tried to use dateTime insted of date_time, but error is the same.</p>
  
  <p><strong>UPD:</strong>
  The original example:</p>
  
  <pre><code>event = Google::Apis::CalendarV3::Event.new{
    summary: 'Google I/O 2015',
    location: '800 Howard St., San Francisco, CA 94103',
    description: 'A chance to hear more about Google\'s developer products.',
    start: {
      date_time: '2015-05-28T09:00:00-07:00',
      time_zone: 'America/Los_Angeles',
    },
    end: {
      date_time: '2015-05-28T17:00:00-07:00',
      time_zone: 'America/Los_Angeles',
    },
    recurrence: [
      'RRULE:FREQ=DAILY;COUNT=2'
    ],
    attendees: [
      {email: 'lpage@example.com'},
      {email: 'sbrin@example.com'},
    ],
    reminders: {
      use_default: false,
      overrides: [
        {method' =&gt; 'email', 'minutes: 24 * 60},
        {method' =&gt; 'popup', 'minutes: 10},
      ],
    },
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/glHzG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/glHzG.png" alt="enter image description here"></a>
  Obviously, there are a lot of syntax errors.
  (missed ')method' => 'popup', 'minutes(missed '): 10</p>
  
  <p>So, I decided to modify it:</p>
  
  <pre><code>event = Google::Apis::CalendarV3::Event.new{
    summary:'Google I/O 2015',
    location:'800 Howard St., San Francisco, CA 94103',
    description:'A chance to hear more about Google\'s developer products.',
    start: {
      date_time:'2015-05-28T09:00:00-07:00',
      time_zone:'America/Los_Angeles',
    },
    end: {
      date_time:'2015-05-28T17:00:00-07:00',
      time_zone:'America/Los_Angeles',
    },
    recurrence: [
      'RRULE:FREQ=DAILY;COUNT=2'
    ],
    attendees: [
      {email: 'lpage@example.com'},
      {email: 'sbrin@example.com'},
    ],
    reminders: {
      use_default: false,
      overrides: [
        {'method' =&gt; 'email', 'minutes'=&gt; 24 * 60},
        {'method' =&gt; 'popup', 'minutes'=&gt; 10},
      ],
    }
  }
  </code></pre>
  
  <p>But, I still got http_command.rb:202:in `check_status': required: Missing end time. (Google::Apis::ClientError)</p>