google-api-ruby-client icon indicating copy to clipboard operation
google-api-ruby-client copied to clipboard

Cannot create extendedProperties

Open kirrg001 opened this issue 4 years ago • 2 comments

Hi there!.

I am using google-apis-calendar_v3. I am trying to add a calendar event with extendedProperties, but it won't work.

      event = ::Google::Apis::CalendarV3::Event.new(
        summary: "#{booking.booking_type.title},#{booking.name}",
        start: ::Google::Apis::CalendarV3::EventDateTime.new(
          date_time: booking.start_date.iso8601,
          time_zone: 'Europe/Berlin'
        ),
        end: ::Google::Apis::CalendarV3::EventDateTime.new(
          date_time: booking.end_date.iso8601,
          time_zone: 'Europe/Berlin'
        ),
        recurrence: [
          'RRULE:FREQ=DAILY;COUNT=1'
        ],
        extendedProperties: {
          private: { 
            'id': 'id'
          }
        }
      )

      result = service.insert_event('primary', event)

The creation works, but if I fetch the event the extended properties are nil. I want to achieve to store a custom field inside the event to recognise it when fetching.

Thanks a lot! Kate

kirrg001 avatar Mar 10 '21 09:03 kirrg001

I have figured it out.

        'extended_properties': {
          'private': {
            'x' => 'y'
          }
        }

Using underscore instead of camel case. Maybe worth adding this to your docs?

kirrg001 avatar Mar 11 '21 07:03 kirrg001

@kirrg001 thank you for the follow up!

danoscarmike avatar Mar 12 '21 23:03 danoscarmike