public CalendarEventParam InsertEvent(CalendarEventParam calendar)
        {
            CalendarService service = new CalendarService(new BaseClientService.Initializer()//new Service
            {
                HttpClientInitializer = credential
            });

            newEvent = new Event()
            {
                Summary     = calendar.summary,//Title of the event.
                Location    = calendar.location,
                Description = calendar.description,
                Start       = new EventDateTime()
                {
                    DateTime = DateTime.Parse(calendar.start_date_time),
                },
                End = new EventDateTime()
                {
                    DateTime = DateTime.Parse(calendar.end_date_time),
                }
            };
            EventsResource.InsertRequest request = service.Events.Insert(newEvent, calendar.calendar_id);

            Event createdEvent = request.Execute();

            return(calendar);
        }
        public CalendarEventParam DeleteEvent(CalendarEventParam calendar)
        {
            CalendarService service = new CalendarService(new BaseClientService.Initializer()//new Service
            {
                HttpClientInitializer = credential
            });

            service.Events.Delete(calendar.calendar_id, calendar.event_id).Execute();
            return(calendar);
        }
        public CalendarEventParam QuickAddEvent(CalendarEventParam calendar)
        {
            CalendarService service = new CalendarService(new BaseClientService.Initializer()//new Service
            {
                HttpClientInitializer = credential
            });

            service.Events.QuickAdd(calendar.calendar_id, calendar.summary).Execute();
            return(calendar);
        }
        public CalendarEventParam GetEvent(CalendarEventParam calendar)
        {
            CalendarService service = new CalendarService(new BaseClientService.Initializer()//new Service
            {
                HttpClientInitializer = credential
            });

            Event event1 = service.Events.Get(calendar.calendar_id, calendar.event_id).Execute();

            calendar.summary         = event1.Summary;
            calendar.start_date_time = event1.Start.DateTimeRaw;
            calendar.end_date_time   = event1.End.DateTimeRaw;
            calendar.description     = event1.Description;
            calendar.location        = event1.Location;
            return(calendar);
        }