// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.data;

/** Information about the logged-in user. */
public class AuthenticationInformation {
  // Note: types cannot be Optional due to JSON conversion.
  private boolean loggedIn;
  private String loginUrl;
  private String logoutUrl;
  private String email;

  /**
   * Creates a logged out user with a URL to log in.
   */
  public AuthenticationInformation(String loginUrl) {
    this.loginUrl = loginUrl;
  }

  /**
   * Creates a logged in user with an email and a URL to log out.
   */
  public AuthenticationInformation(String logoutUrl, String email) {
    this.loggedIn = true;
    this.logoutUrl = logoutUrl;
    this.email = email;
  }
}

@@ -768,16 +768,22 @@
 private 
+final 
 boolean 
@@ -794,32 +794,38 @@
 edIn;%0A  private 
+final 
 String loginUrl;
@@ -831,24 +831,30 @@
 ;%0A  private 
+final 
 String logou
@@ -869,16 +869,22 @@
 private 
+final 
 String e
@@ -1005,24 +1005,51 @@
 loginUrl) %7B%0A
+    this.loggedIn = false;%0A
     this.log
@@ -1065,16 +1065,57 @@
 oginUrl;
+%0A%0A    this.logoutUrl = this.email = null;
 %0A  %7D%0A%0A  
@@ -1317,16 +1317,16 @@
 outUrl;%0A
-
     this
@@ -1340,15 +1340,42 @@
 = email;
+%0A%0A    this.loginUrl = null;
 %0A  %7D%0A%7D%0A

Mark AuthenticationInformation fields final.