chromium/google_apis/calendar/calendar_api_requests.h

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GOOGLE_APIS_CALENDAR_CALENDAR_API_REQUESTS_H_
#define GOOGLE_APIS_CALENDAR_CALENDAR_API_REQUESTS_H_

#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "google_apis/calendar/calendar_api_response_types.h"
#include "google_apis/calendar/calendar_api_url_generator.h"
#include "google_apis/common/api_error_codes.h"
#include "google_apis/common/base_requests.h"

namespace google_apis {

namespace calendar {

// A marker to indicate an event has been injected with its calendar's colorId.
inline const std::string kInjectedColorIdPrefix =;
inline constexpr char kPrimaryCalendarId[] =;

// Callback used for requests that the server returns Calendar List
// data formatted into JSON value.
CalendarListCallback;

// Callback used for requests that the server returns Events data
// formatted into JSON value.
CalendarEventListCallback;

// This is base class of the Calendar API related requests.
class CalendarApiGetRequest : public UrlFetchRequestBase {};

// Request to fetch the list of the user's calendars.
class CalendarApiCalendarListRequest : public CalendarApiGetRequest {};

// Request to fetch calendar events. By default, an event fetch for the primary
// calendar is requested. If a calendar ID is passed, an event fetch is
// requested for the calendar matching that ID.
// Only fetches a maximum of 1 attendee per event.
// |url_generator|  The UrlGenerator to use for the request.
// |callback|       The callback to send the parsed |EventList| to when the
//                  request is complete.
// |start_time|     The minimum time to fetch events for. This will filter
//                  out events with an end time before this value.
// |end_time|       The maximum time to fetch events for. This will filter
//                  out events with a start time after this value.
class CalendarApiEventsRequest : public CalendarApiGetRequest {};

}  // namespace calendar
}  // namespace google_apis

#endif  // GOOGLE_APIS_CALENDAR_CALENDAR_API_REQUESTS_H_