#include "google_apis/calendar/calendar_api_requests.h"
#include <stddef.h>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/memory/weak_ptr.h"
#include "base/strings/strcat.h"
#include "base/values.h"
#include "google_apis/calendar/calendar_api_response_types.h"
#include "google_apis/common/api_error_codes.h"
#include "google_apis/common/base_requests.h"
#include "google_apis/common/request_sender.h"
#include "net/base/url_util.h"
namespace google_apis {
namespace calendar {
namespace {
void FillEmptyColorFields(EventList* events, const std::string& color) { … }
constexpr char kFieldsParameterName[] = …;
constexpr int kMaxAttendees = …;
constexpr int kMaxCalendars = …;
constexpr int kMaxResults = …;
constexpr char kCalendarListFields[] = …;
std::string GetCalendarEventListFields(bool include_attachments) { … }
}
CalendarApiGetRequest::CalendarApiGetRequest(RequestSender* sender,
const std::string& fields)
: … { … }
CalendarApiGetRequest::~CalendarApiGetRequest() = default;
GURL CalendarApiGetRequest::GetURL() const { … }
ApiErrorCode CalendarApiGetRequest::MapReasonToError(
ApiErrorCode code,
const std::string& reason) { … }
bool CalendarApiGetRequest::IsSuccessfulErrorCode(ApiErrorCode error) { … }
CalendarApiCalendarListRequest::CalendarApiCalendarListRequest(
RequestSender* sender,
const CalendarApiUrlGenerator& url_generator,
CalendarListCallback callback)
: … { … }
CalendarApiCalendarListRequest::~CalendarApiCalendarListRequest() = default;
GURL CalendarApiCalendarListRequest::GetURLInternal() const { … }
void CalendarApiCalendarListRequest::ProcessURLFetchResults(
const network::mojom::URLResponseHead* response_head,
base::FilePath response_file,
std::string response_body) { … }
void CalendarApiCalendarListRequest::RunCallbackOnPrematureFailure(
ApiErrorCode error) { … }
std::unique_ptr<CalendarList> CalendarApiCalendarListRequest::Parse(
std::string json) { … }
void CalendarApiCalendarListRequest::OnDataParsed(
ApiErrorCode error,
std::unique_ptr<CalendarList> calendars) { … }
CalendarApiEventsRequest::CalendarApiEventsRequest(
RequestSender* sender,
const CalendarApiUrlGenerator& url_generator,
CalendarEventListCallback callback,
const base::Time& start_time,
const base::Time& end_time,
const std::string& calendar_id,
const std::string& calendar_color_id)
: … { … }
CalendarApiEventsRequest::CalendarApiEventsRequest(
RequestSender* sender,
const CalendarApiUrlGenerator& url_generator,
CalendarEventListCallback callback,
const base::Time& start_time,
const base::Time& end_time,
bool include_attachments)
: … { … }
CalendarApiEventsRequest::CalendarApiEventsRequest(
RequestSender* sender,
const CalendarApiUrlGenerator& url_generator,
CalendarEventListCallback callback,
const base::Time& start_time,
const base::Time& end_time,
const std::vector<EventType>& event_types,
const std::string& experiment,
const std::string& order_by,
bool include_attachments)
: … { … }
CalendarApiEventsRequest::~CalendarApiEventsRequest() = default;
GURL CalendarApiEventsRequest::GetURLInternal() const { … }
void CalendarApiEventsRequest::ProcessURLFetchResults(
const network::mojom::URLResponseHead* response_head,
base::FilePath response_file,
std::string response_body) { … }
void CalendarApiEventsRequest::RunCallbackOnPrematureFailure(
ApiErrorCode error) { … }
std::unique_ptr<EventList> CalendarApiEventsRequest::Parse(std::string json) { … }
void CalendarApiEventsRequest::OnDataParsed(ApiErrorCode error,
std::unique_ptr<EventList> events) { … }
}
}