mcp-gmailcal 0.10.0

A MCP server for google mail, calendar, and contacts.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
/// Calendar API Tests Module
///
/// This module contains comprehensive tests for the Google Calendar API functionality,
/// focusing on calendar operations, event management, and datetime handling.
///
use chrono::{DateTime, Duration, TimeZone, Utc};
use mockall::mock;
use mcp_gmailcal::calendar_api::{Attendee, CalendarEvent, CalendarInfo, CalendarList, ConferenceData, ConferenceSolution, EntryPoint, EventOrganizer};
use mcp_gmailcal::errors::CalendarApiError;
use reqwest::Client;
use std::sync::Arc;
use std::sync::Mutex;
use uuid::Uuid;

// Define a proper interface for CalendarClient that we can mock
trait CalendarClientInterface {
    fn list_calendars(&self) -> Result<CalendarList, CalendarApiError>;
    fn list_events(
        &self,
        calendar_id: &str,
        max_results: Option<u32>,
        time_min: Option<DateTime<Utc>>,
        time_max: Option<DateTime<Utc>>,
    ) -> Result<Vec<CalendarEvent>, CalendarApiError>;
    fn create_event(
        &self,
        calendar_id: &str,
        event: CalendarEvent,
    ) -> Result<CalendarEvent, CalendarApiError>;
    fn get_event(
        &self,
        calendar_id: &str,
        event_id: &str,
    ) -> Result<CalendarEvent, CalendarApiError>;
}

// Wrapper for CalendarClient that we can test against
struct MockableCalendarClient {
    client: Arc<Mutex<dyn CalendarClientInterface + Send + Sync>>,
}

impl MockableCalendarClient {
    fn new(client: Arc<Mutex<dyn CalendarClientInterface + Send + Sync>>) -> Self {
        Self { client }
    }

    fn list_calendars(&self) -> Result<CalendarList, CalendarApiError> {
        let client = self.client.lock().unwrap();
        client.list_calendars()
    }

    fn list_events(
        &self,
        calendar_id: &str,
        max_results: Option<u32>,
        time_min: Option<DateTime<Utc>>,
        time_max: Option<DateTime<Utc>>,
    ) -> Result<Vec<CalendarEvent>, CalendarApiError> {
        let client = self.client.lock().unwrap();
        client.list_events(calendar_id, max_results, time_min, time_max)
    }

    fn create_event(
        &self,
        calendar_id: &str,
        event: CalendarEvent,
    ) -> Result<CalendarEvent, CalendarApiError> {
        let client = self.client.lock().unwrap();
        client.create_event(calendar_id, event)
    }

    fn get_event(
        &self,
        calendar_id: &str,
        event_id: &str,
    ) -> Result<CalendarEvent, CalendarApiError> {
        let client = self.client.lock().unwrap();
        client.get_event(calendar_id, event_id)
    }
}

// Mock implementation of CalendarClientInterface for testing
struct MockCalendarClient {
    calendars: Vec<CalendarInfo>,
    events: Vec<CalendarEvent>,
    should_fail: bool,
}

impl MockCalendarClient {
    fn new() -> Self {
        // Initialize with sample data
        let calendars = vec![
            CalendarInfo {
                id: "primary".to_string(),
                summary: "Primary Calendar".to_string(),
                description: Some("Your main calendar".to_string()),
                primary: Some(true),
            },
            CalendarInfo {
                id: "work@example.com".to_string(),
                summary: "Work Calendar".to_string(),
                description: Some("Calendar for work events".to_string()),
                primary: Some(false),
            },
            CalendarInfo {
                id: "family@example.com".to_string(),
                summary: "Family Calendar".to_string(),
                description: Some("Calendar for family events".to_string()),
                primary: Some(false),
            },
        ];

        let events = vec![
            create_test_event("event1", "Meeting with team", "Office", Utc::now() + Duration::hours(1), Utc::now() + Duration::hours(2)),
            create_test_event("event2", "Lunch with client", "Restaurant", Utc::now() + Duration::hours(5), Utc::now() + Duration::hours(6)),
            create_test_event("event3", "Project deadline", "Office", Utc::now() + Duration::days(2), Utc::now() + Duration::days(2) + Duration::hours(8)),
        ];

        Self {
            calendars,
            events,
            should_fail: false,
        }
    }

    fn with_failure(mut self) -> Self {
        self.should_fail = true;
        self
    }
}

impl CalendarClientInterface for MockCalendarClient {
    fn list_calendars(&self) -> Result<CalendarList, CalendarApiError> {
        if self.should_fail {
            return Err(CalendarApiError::ApiError("Failed to list calendars".to_string()));
        }
        
        Ok(CalendarList {
            calendars: self.calendars.clone(),
            next_page_token: None,
        })
    }

    fn list_events(
        &self,
        calendar_id: &str,
        max_results: Option<u32>,
        time_min: Option<DateTime<Utc>>,
        time_max: Option<DateTime<Utc>>,
    ) -> Result<Vec<CalendarEvent>, CalendarApiError> {
        if self.should_fail {
            return Err(CalendarApiError::ApiError("Failed to list events".to_string()));
        }

        if calendar_id.is_empty() {
            return Err(CalendarApiError::ApiError("Calendar ID cannot be empty".to_string()));
        }

        // Filter events based on criteria
        let filtered_events = self.events.iter()
            .filter(|event| {
                // Match calendar ID (we're simplifying here by not actually filtering by calendar)
                
                // Filter by time range if specified
                let time_min_check = match time_min {
                    Some(min_time) => event.start_time >= min_time,
                    None => true,
                };

                let time_max_check = match time_max {
                    Some(max_time) => event.start_time <= max_time,
                    None => true,
                };

                time_min_check && time_max_check
            })
            .cloned()
            .collect::<Vec<CalendarEvent>>();

        // Apply max_results if specified
        if let Some(max) = max_results {
            Ok(filtered_events.into_iter().take(max as usize).collect())
        } else {
            Ok(filtered_events)
        }
    }

    fn create_event(
        &self,
        calendar_id: &str,
        mut event: CalendarEvent,
    ) -> Result<CalendarEvent, CalendarApiError> {
        if self.should_fail {
            return Err(CalendarApiError::ApiError("Failed to create event".to_string()));
        }

        if calendar_id.is_empty() {
            return Err(CalendarApiError::ApiError("Calendar ID cannot be empty".to_string()));
        }

        // Basic validation
        if event.summary.is_empty() {
            return Err(CalendarApiError::EventFormatError("Event summary cannot be empty".to_string()));
        }

        if event.end_time <= event.start_time {
            return Err(CalendarApiError::EventFormatError("End time must be after start time".to_string()));
        }

        // Assign an ID if not present
        if event.id.is_none() {
            event.id = Some(Uuid::new_v4().to_string());
        }

        // Add HTML link if not present
        if event.html_link.is_none() {
            event.html_link = Some(format!(
                "https://calendar.google.com/calendar/event?eid={}",
                event.id.as_ref().unwrap()
            ));
        }

        Ok(event)
    }

    fn get_event(
        &self,
        calendar_id: &str,
        event_id: &str,
    ) -> Result<CalendarEvent, CalendarApiError> {
        if self.should_fail {
            return Err(CalendarApiError::ApiError("Failed to get event".to_string()));
        }

        if calendar_id.is_empty() {
            return Err(CalendarApiError::ApiError("Calendar ID cannot be empty".to_string()));
        }

        if event_id.is_empty() {
            return Err(CalendarApiError::ApiError("Event ID cannot be empty".to_string()));
        }

        // Find event by ID
        let event = self.events.iter()
            .find(|e| e.id.as_ref().map_or(false, |id| id == event_id))
            .cloned();

        match event {
            Some(event) => Ok(event),
            None => Err(CalendarApiError::EventRetrievalError(format!("Event {} not found", event_id))),
        }
    }
}

// Helper function to create a test event
fn create_test_event(
    id: &str,
    summary: &str,
    location: &str,
    start_time: DateTime<Utc>,
    end_time: DateTime<Utc>,
) -> CalendarEvent {
    CalendarEvent {
        id: Some(id.to_string()),
        summary: summary.to_string(),
        description: Some(format!("Description for {}", summary)),
        location: Some(location.to_string()),
        creator: Some(EventOrganizer {
            email: "creator@example.com".to_string(),
            display_name: Some("Event Creator".to_string()),
            self_: Some(true),
        }),
        organizer: Some(EventOrganizer {
            email: "organizer@example.com".to_string(),
            display_name: Some("Event Organizer".to_string()),
            self_: Some(false),
        }),
        start_time,
        end_time,
        attendees: vec![
            Attendee {
                email: "attendee1@example.com".to_string(),
                display_name: Some("Attendee 1".to_string()),
                response_status: Some("accepted".to_string()),
                optional: None,
            },
            Attendee {
                email: "attendee2@example.com".to_string(),
                display_name: Some("Attendee 2".to_string()),
                response_status: Some("tentative".to_string()),
                optional: None,
            },
        ],
        html_link: Some(format!(
            "https://calendar.google.com/calendar/event?eid={}",
            id
        )),
        conference_data: Some(ConferenceData {
            conference_solution: Some(ConferenceSolution {
                name: "Google Meet".to_string(),
                key: Some("meet".to_string()),
            }),
            entry_points: vec![
                EntryPoint {
                    entry_point_type: "video".to_string(),
                    uri: "https://meet.google.com/abc-defg-hij".to_string(),
                    label: Some("Google Meet".to_string()),
                },
                EntryPoint {
                    entry_point_type: "phone".to_string(),
                    uri: "tel:+11234567890".to_string(),
                    label: Some("Phone".to_string()),
                },
            ],
        }),
    }
}

// Helper function to create a test calendar with conference data
fn create_test_calendar(id: &str, summary: &str, is_primary: bool) -> CalendarInfo {
    CalendarInfo {
        id: id.to_string(),
        summary: summary.to_string(),
        description: Some(format!("Description for {}", summary)),
        primary: Some(is_primary),
    }
}

// Mock Calendar API Tests
#[cfg(test)]
mod comprehensive_calendar_tests {
    use super::*;

    // Helper to create a test client
    fn create_test_client() -> MockableCalendarClient {
        let mock_client = MockCalendarClient::new();
        let client = Arc::new(Mutex::new(mock_client));
        MockableCalendarClient::new(client)
    }

    // Helper to create a failing test client
    fn create_failing_client() -> MockableCalendarClient {
        let mock_client = MockCalendarClient::new().with_failure();
        let client = Arc::new(Mutex::new(mock_client));
        MockableCalendarClient::new(client)
    }

    #[test]
    fn test_list_calendars_success() {
        let client = create_test_client();
        let result = client.list_calendars();
        
        assert!(result.is_ok());
        let calendars = result.unwrap();
        
        // Verify count
        assert_eq!(calendars.calendars.len(), 3);
        
        // Verify primary calendar
        let primary = calendars.calendars.iter().find(|c| c.primary == Some(true)).unwrap();
        assert_eq!(primary.id, "primary");
        assert_eq!(primary.summary, "Primary Calendar");
        
        // Verify other calendars
        let work_calendar = calendars.calendars.iter().find(|c| c.id == "work@example.com").unwrap();
        assert_eq!(work_calendar.summary, "Work Calendar");
        
        let family_calendar = calendars.calendars.iter().find(|c| c.id == "family@example.com").unwrap();
        assert_eq!(family_calendar.summary, "Family Calendar");
    }

    #[test]
    fn test_list_calendars_failure() {
        let client = create_failing_client();
        let result = client.list_calendars();
        
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::ApiError(msg)) => {
                assert_eq!(msg, "Failed to list calendars");
            }
            _ => panic!("Expected ApiError"),
        }
    }

    #[test]
    fn test_list_events_success() {
        let client = create_test_client();

        // Test listing events with various parameters
        
        // No filters
        let result = client.list_events("primary", None, None, None);
        assert!(result.is_ok());
        let events = result.unwrap();
        assert_eq!(events.len(), 3); // All events
        
        // With max_results
        let result = client.list_events("primary", Some(2), None, None);
        assert!(result.is_ok());
        let events = result.unwrap();
        assert_eq!(events.len(), 2); // Limited to 2 events
        
        // With time filters - future implementation would test this more thoroughly
        let time_min = Utc::now();
        let result = client.list_events("primary", None, Some(time_min), None);
        assert!(result.is_ok());
        // All events should be after time_min because they're created in the future
        let events = result.unwrap();
        assert!(events.len() > 0);
        for event in events {
            assert!(event.start_time >= time_min);
        }
    }

    #[test]
    fn test_list_events_failure() {
        let client = create_failing_client();
        let result = client.list_events("primary", None, None, None);
        
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::ApiError(msg)) => {
                assert_eq!(msg, "Failed to list events");
            }
            _ => panic!("Expected ApiError"),
        }
    }

    #[test]
    fn test_create_event_success() {
        let client = create_test_client();

        // Create a new event
        let new_event = CalendarEvent {
            id: None, // Will be assigned
            summary: "New Test Event".to_string(),
            description: Some("Description for new test event".to_string()),
            location: Some("Test Location".to_string()),
            start_time: Utc::now() + Duration::hours(24),
            end_time: Utc::now() + Duration::hours(25),
            attendees: vec![
                Attendee {
                    email: "test@example.com".to_string(),
                    display_name: Some("Test User".to_string()),
                    response_status: None,
                    optional: None,
                },
            ],
            html_link: None, // Will be assigned
            conference_data: None,
            creator: None,
            organizer: None,
        };

        let result = client.create_event("primary", new_event.clone());
        
        assert!(result.is_ok());
        let created_event = result.unwrap();
        
        // Verify ID was assigned
        assert!(created_event.id.is_some());
        // Verify HTML link was assigned
        assert!(created_event.html_link.is_some());
        // Verify other fields match
        assert_eq!(created_event.summary, new_event.summary);
        assert_eq!(created_event.description, new_event.description);
        assert_eq!(created_event.location, new_event.location);
        assert_eq!(created_event.start_time, new_event.start_time);
        assert_eq!(created_event.end_time, new_event.end_time);
    }

    #[test]
    fn test_create_event_validation_failure() {
        let client = create_test_client();

        // Test invalid events
        
        // Empty summary
        let invalid_event = CalendarEvent {
            id: None,
            summary: "".to_string(), // Empty summary
            description: Some("Description".to_string()),
            location: Some("Location".to_string()),
            start_time: Utc::now() + Duration::hours(1),
            end_time: Utc::now() + Duration::hours(2),
            attendees: vec![],
            html_link: None,
            conference_data: None,
            creator: None,
            organizer: None,
        };

        let result = client.create_event("primary", invalid_event);
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::EventFormatError(msg)) => {
                assert!(msg.contains("summary cannot be empty"));
            }
            _ => panic!("Expected EventFormatError"),
        }

        // End time before start time
        let invalid_event = CalendarEvent {
            id: None,
            summary: "Invalid Time Event".to_string(),
            description: Some("Description".to_string()),
            location: Some("Location".to_string()),
            start_time: Utc::now() + Duration::hours(2), // Later
            end_time: Utc::now() + Duration::hours(1),   // Earlier
            attendees: vec![],
            html_link: None,
            conference_data: None,
            creator: None,
            organizer: None,
        };

        let result = client.create_event("primary", invalid_event);
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::EventFormatError(msg)) => {
                assert!(msg.contains("End time must be after start time"));
            }
            _ => panic!("Expected EventFormatError"),
        }

        // Empty calendar ID
        let valid_event = CalendarEvent {
            id: None,
            summary: "Valid Event".to_string(),
            description: Some("Description".to_string()),
            location: Some("Location".to_string()),
            start_time: Utc::now() + Duration::hours(1),
            end_time: Utc::now() + Duration::hours(2),
            attendees: vec![],
            html_link: None,
            conference_data: None,
            creator: None,
            organizer: None,
        };

        let result = client.create_event("", valid_event);
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::ApiError(msg)) => {
                assert!(msg.contains("Calendar ID cannot be empty"));
            }
            _ => panic!("Expected ApiError"),
        }
    }

    #[test]
    fn test_create_event_failure() {
        let client = create_failing_client();

        let event = CalendarEvent {
            id: None,
            summary: "Test Event".to_string(),
            description: Some("Description".to_string()),
            location: Some("Location".to_string()),
            start_time: Utc::now() + Duration::hours(1),
            end_time: Utc::now() + Duration::hours(2),
            attendees: vec![],
            html_link: None,
            conference_data: None,
            creator: None,
            organizer: None,
        };

        let result = client.create_event("primary", event);
        
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::ApiError(msg)) => {
                assert_eq!(msg, "Failed to create event");
            }
            _ => panic!("Expected ApiError"),
        }
    }

    #[test]
    fn test_get_event_success() {
        let client = create_test_client();

        // Get existing event
        let result = client.get_event("primary", "event1");
        
        assert!(result.is_ok());
        let event = result.unwrap();
        
        // Verify event details
        assert_eq!(event.id, Some("event1".to_string()));
        assert_eq!(event.summary, "Meeting with team");
        assert_eq!(event.location, Some("Office".to_string()));
        
        // Verify conference data
        assert!(event.conference_data.is_some());
        let conference_data = event.conference_data.unwrap();
        assert!(conference_data.conference_solution.is_some());
        assert_eq!(conference_data.conference_solution.unwrap().name, "Google Meet");
        assert_eq!(conference_data.entry_points.len(), 2);
        
        // Verify attendees
        assert_eq!(event.attendees.len(), 2);
        assert_eq!(event.attendees[0].email, "attendee1@example.com");
        assert_eq!(event.attendees[1].email, "attendee2@example.com");
    }

    #[test]
    fn test_get_event_not_found() {
        let client = create_test_client();

        // Get non-existent event
        let result = client.get_event("primary", "nonexistent");
        
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::EventRetrievalError(msg)) => {
                assert!(msg.contains("Event nonexistent not found"));
            }
            _ => panic!("Expected EventRetrievalError"),
        }
    }

    #[test]
    fn test_get_event_invalid_params() {
        let client = create_test_client();

        // Empty calendar ID
        let result = client.get_event("", "event1");
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::ApiError(msg)) => {
                assert!(msg.contains("Calendar ID cannot be empty"));
            }
            _ => panic!("Expected ApiError"),
        }

        // Empty event ID
        let result = client.get_event("primary", "");
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::ApiError(msg)) => {
                assert!(msg.contains("Event ID cannot be empty"));
            }
            _ => panic!("Expected ApiError"),
        }
    }

    #[test]
    fn test_get_event_failure() {
        let client = create_failing_client();

        let result = client.get_event("primary", "event1");
        
        assert!(result.is_err());
        match result {
            Err(CalendarApiError::ApiError(msg)) => {
                assert_eq!(msg, "Failed to get event");
            }
            _ => panic!("Expected ApiError"),
        }
    }

    #[test]
    fn test_timezone_handling() {
        // Create events with different timezone representations
        
        // UTC time
        let utc_time = Utc.ymd(2025, 5, 15).and_hms(10, 0, 0);
        
        // UTC+2 (e.g., Berlin)
        let berlin_time = DateTime::parse_from_rfc3339("2025-05-15T12:00:00+02:00").unwrap();
        let berlin_in_utc = berlin_time.with_timezone(&Utc);
        
        // UTC-7 (e.g., Pacific Time)
        let pt_time = DateTime::parse_from_rfc3339("2025-05-15T03:00:00-07:00").unwrap();
        let pt_in_utc = pt_time.with_timezone(&Utc);
        
        // All should equal 10:00 UTC
        assert_eq!(utc_time.to_rfc3339(), "2025-05-15T10:00:00+00:00");
        assert_eq!(berlin_in_utc.to_rfc3339(), "2025-05-15T10:00:00+00:00");
        assert_eq!(pt_in_utc.to_rfc3339(), "2025-05-15T10:00:00+00:00");
    }
    
    #[test]
    fn test_all_day_event_handling() {
        // In the real API, all-day events are handled differently
        // They use date strings instead of dateTime
        // For this test, we'll check our functionality for handling dates
        
        // Start of day in UTC
        let start_of_day = Utc.ymd(2025, 5, 15).and_hms(0, 0, 0);
        
        // End of day in UTC
        let end_of_day = Utc.ymd(2025, 5, 15).and_hms(23, 59, 59);
        
        assert_eq!(start_of_day.to_rfc3339(), "2025-05-15T00:00:00+00:00");
        assert_eq!(end_of_day.to_rfc3339(), "2025-05-15T23:59:59+00:00");
        
        // For a 24-hour period, we can format dates as ISO 8601 dates
        let date_str = "2025-05-15";
        assert_eq!(date_str, "2025-05-15");
    }

    #[test]
    fn test_recurring_event_parameters() {
        // The CalendarEvent struct doesn't currently have recurrence fields
        // but we can test the validation logic for recurring events
        
        // For recurring events, we would validate:
        // 1. The recurrence rule syntax (RRULE)
        // 2. The frequency (DAILY, WEEKLY, MONTHLY, YEARLY)
        // 3. The count or until date
        
        // For now, we'll just confirm our basic event structure works
        let client = create_test_client();
        
        let event = CalendarEvent {
            id: None,
            summary: "Recurring Test Event".to_string(),
            description: Some("This would be a recurring event".to_string()),
            location: Some("Test Location".to_string()),
            start_time: Utc::now() + Duration::hours(1),
            end_time: Utc::now() + Duration::hours(2),
            attendees: vec![],
            html_link: None,
            conference_data: None,
            creator: None,
            organizer: None,
        };
        
        let result = client.create_event("primary", event);
        assert!(result.is_ok());
    }

    #[test]
    fn test_conference_data_handling() {
        // Test creation and retrieval of events with conference data
        let client = create_test_client();
        
        // Get event with conference data
        let result = client.get_event("primary", "event1");
        assert!(result.is_ok());
        
        let event = result.unwrap();
        assert!(event.conference_data.is_some());
        
        let conf_data = event.conference_data.unwrap();
        assert!(conf_data.conference_solution.is_some());
        
        let solution = conf_data.conference_solution.unwrap();
        assert_eq!(solution.name, "Google Meet");
        assert_eq!(solution.key, Some("meet".to_string()));
        
        // Check entry points
        assert_eq!(conf_data.entry_points.len(), 2);
        
        // Find video entry point
        let video_entry = conf_data.entry_points.iter()
            .find(|ep| ep.entry_point_type == "video")
            .unwrap();
        assert!(video_entry.uri.contains("meet.google.com"));
        
        // Find phone entry point
        let phone_entry = conf_data.entry_points.iter()
            .find(|ep| ep.entry_point_type == "phone")
            .unwrap();
        assert!(phone_entry.uri.contains("tel:"));
    }
}