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

#ifndef CHROMEOS_ASH_COMPONENTS_BOCA_SESSION_API_CONSTANTS_H_
#define CHROMEOS_ASH_COMPONENTS_BOCA_SESSION_API_CONSTANTS_H_

#include "google_apis/gaia/gaia_auth_fetcher.h"

namespace ash::boca {

inline constexpr char kCreateSessionUrlTemplate[] = "v1/teachers/$1/sessions";

inline constexpr char kContentTypeApplicationJson[] = "application/json";

inline constexpr char kMainStudentGroupName[] = "main";
inline constexpr char kAccessCodeGroupName[] = "accessCode";

inline constexpr char kSchoolToolsAuthScope[] =
    "https://www.googleapis.com/auth/chromeosschooltools";

inline constexpr char kGetSessionUrlTemplate[] =
    "v1/users/$1/sessions:getActive?device.device_id=$2";

inline constexpr char kGetGeminiStatusUrlTemplate[] =
    "v1/users/$1:getGeminiStatus";

inline constexpr char kUploadFCMTokenTemplate[] = "v1/users/$1";

inline constexpr char kUpdateSessionUrlTemplate[] =
    "v1/teachers/$1/sessions/$2?updateMask=$3";

inline constexpr char kUpdateSessionConfigUrlTemplate[] =
    "v1/teachers/$1/sessions/$2:updateConfig";

inline constexpr char kUpdateSessionConfigUrlTemplateWithUpdateMask[] =
    "v1/teachers/$1/sessions/$2:updateConfig?updateMask=$3";

inline constexpr char kInsertStudentActivity[] =
    "v1/sessions/$1/students/$2/devices/$3/activities:insert";

inline constexpr char kRemoveStudentUrlTemplate[] =
    "v1/teachers/$1/sessions/$2/students:remove";

inline constexpr char kAddStudentsUrlTemplate[] =
    "v1/teachers/$1/sessions/$2/students:add";

inline constexpr char kJoinTachyonGroupUrlTemplate[] =
    "/v1/students/$1/sessions/$2/tachyon:join";

inline constexpr char kJoinSessionUrlTemplate[] = "v1/students/$1/session:join";

inline constexpr char kViewScreenUrlTemplate[] =
    "v1/sessions/$1/viewScreen:initiate";

inline constexpr char kRegisterScreenUrlTemplate[] =
    "v1/sessions/$1/viewScreen:register";

inline constexpr char kUpdateViewScreenStateUrlTemplate[] =
    "v1/sessions/$1/viewScreen:updateState";

inline constexpr char kStudentHeartbeatUrlTemplate[] =
    "v1/sessions/$1/students/$2/devices/$3:heartbeat?studentGroupId=$4";

inline constexpr char kNotifyGetActiveSession[] =
    "v1/teachers/$1/sessions/$2/students:notifyGetActiveSession";

inline constexpr char kGetKioskReceiverWithoutConnectionIdUrlTemplate[] =
    "/v1/receivers/$1";

inline constexpr char kGetKioskReceiverUrlTemplate[] =
    "/v1/receivers/$1?connectionId=$2";

inline constexpr char kStartKioskReceiverUrlTemplate[] =
    "/v1/receivers/$1:start";

inline constexpr char kSessionId[] = "sessionId";
inline constexpr char kTeacher[] = "teacher";
inline constexpr char kRoster[] = "roster";
inline constexpr char kRosterTitle[] = "title";
inline constexpr char kStudentGroupTitle[] = "title";
inline constexpr char kStudentGroups[] = "studentGroups";
inline constexpr char kStudentGroupIds[] = "studentGroupIds";
inline constexpr char kStudents[] = "students";
inline constexpr char kGaiaId[] = "gaiaId";
inline constexpr char kEmail[] = "email";
inline constexpr char kFullName[] = "fullName";
inline constexpr char kPhotoUrl[] = "photoUrl";
inline constexpr char kStudentGroupsConfig[] = "studentGroupConfigs";
inline constexpr char kStartTime[] = "startTime";
inline constexpr char kDuration[] = "duration";
inline constexpr char kSessionState[] = "sessionState";
inline constexpr char kOnTaskConfig[] = "onTaskConfig";
inline constexpr char kSessionConfig[] = "sessionConfig";
inline constexpr char kCaptionsConfig[] = "captionsConfig";
inline constexpr char kCaptionsEnabled[] = "captionsEnabled";
inline constexpr char kTranslationsEnabled[] = "translationsEnabled";
inline constexpr char kStudentStatus[] = "studentStatuses";
inline constexpr char kStudentStatusState[] = "state";
inline constexpr char kDeviceStatusState[] = "state";
inline constexpr char kReceiverConnectionState[] = "receiverConnectionState";
inline constexpr char kGeminiEnablementState[] = "geminiEnablementState";
inline constexpr char kGeminiStateEnabled[] = "GEMINI_ENABLEMENT_STATE_ENABLED";
inline constexpr char kGeminiStateDisabled[] =
    "GEMINI_ENABLEMENT_STATE_DISABLED";
inline constexpr char kGeminiStatusFetchResponseTemplate[] =
    R"({"geminiEnablementState": "$1"})";
inline constexpr char kUrl[] = "url";
inline constexpr char kTitle[] = "title";
inline constexpr char kFavIcon[] = "faviconUrl";
inline constexpr char kUrlType[] = "urlType";
inline constexpr char kContentConfigs[] = "contentConfigs";
inline constexpr char kActiveBundle[] = "activeBundle";
inline constexpr char kLocked[] = "locked";
inline constexpr char kLockToAppHome[] = "lockToAppHome";
inline constexpr char kLockedNavigationOptions[] = "lockedNavigationOptions";
inline constexpr char kNavigationType[] = "navigationType";
inline constexpr char kSeconds[] = "seconds";
inline constexpr char kNanos[] = "nanos";
inline constexpr char kRequestTime[] = "requestTime";
inline constexpr char kActivities[] = "activities";
inline constexpr char kActiveTab[] = "activeTab";
inline constexpr char kDevice[] = "device";
inline constexpr char kDevices[] = "devices";
inline constexpr char kDeviceId[] = "deviceId";
inline constexpr char kActivity[] = "activity";
inline constexpr char kUsers[] = "users";
inline constexpr char kUser[] = "user";
inline constexpr char kTachyonGroupId[] = "tachyonGroupId";
inline constexpr char kJoinCode[] = "joinCode";
inline constexpr char kJoinCodeEnabled[] = "enabled";
inline constexpr char kCode[] = "code";
inline constexpr char kSessionJoinCode[] = "sessionJoinCode";
inline constexpr char kDeviceInfo[] = "deviceInfo";
inline constexpr char kStudent[] = "student";
inline constexpr char kGroupSource[] = "groupSource";
inline constexpr char kTeacherClientDevice[] = "teacherClientDevice";
inline constexpr char kHostDevice[] = "hostDevice";
inline constexpr char kSpotlightConnectionCode[] = "connectionCode";
inline constexpr char kSpotlightConnectionParam[] = "connectionParam";
inline constexpr char kViewScreenRequester[] = "viewScreenRequester";
inline constexpr char kServiceAccount[] = "serviceAccount";
inline constexpr char kStudentGroupId[] = "studentGroupId";
inline constexpr char kViewScreenConfig[] = "viewScreenConfig";
inline constexpr char kViewScreenState[] = "viewScreenState";
inline constexpr char kRobotEmail[] = "robotEmail";
inline constexpr char kConnection[] = "connection";
inline constexpr char kConnectionId[] = "connectionId";
inline constexpr char kConnectionCode[] = "connectionCode";
inline constexpr char kInitiator[] = "initiator";
inline constexpr char kPresenter[] = "presenter";

inline constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
    net::DefineNetworkTrafficAnnotation("boca_server_integration", R"(
          semantics: {
            sender: "Boca"
            description: "Provide ChromeOS access to school tools server"
            internal {
              contacts {
                  email: "cros-edu-eng@google.com"
              }
            }
            user_data {
              type: ACCESS_TOKEN
              type: EMAIL
              type: NAME
            }
            trigger: "User opens Boca app and goes through session start flow."
            data: "The request is authenticated with an OAuth2 access token "
                  "identifying the Google account.
            destination: GOOGLE_OWNED_SERVICE
            last_reviewed: "2024-06-26"
          }
          policy: {
            cookies_allowed: NO
            setting: "This feature cannot be disabled by settings yet."
            policy_exception_justification: "Not implemented yet."
          })");

}  // namespace ash::boca

#endif  // CHROMEOS_ASH_COMPONENTS_BOCA_SESSION_API_CONSTANTS_H_
