// Path: library/src/main/java/com/pokegoapi/exceptions/request/InvalidCredentialsException.java
// public class InvalidCredentialsException extends RequestFailedException {
// 	public InvalidCredentialsException() {
// 		super();
// 	}
// 
// 	public InvalidCredentialsException(String reason) {
// 		super(reason);
// 	}
// 
// 	public InvalidCredentialsException(Throwable exception) {
// 		super(exception);
// 	}
// 
// 	public InvalidCredentialsException(String reason, Throwable exception) {
// 		super(reason, exception);
// 	}
// }


import POGOProtos.Networking.Envelopes.RequestEnvelopeOuterClass.RequestEnvelope.AuthInfo;
import com.pokegoapi.exceptions.request.InvalidCredentialsException;
import com.pokegoapi.exceptions.request.LoginFailedException;
import com.pokegoapi.util.SystemTimeImpl;
import com.pokegoapi.util.Time;
import lombok.Getter;
import okhttp3.OkHttpClient;
import svarzee.gps.gpsoauth.AuthToken;
import svarzee.gps.gpsoauth.Gpsoauth;
import java.io.IOException;
package com.pokegoapi.auth;



/**
 * Use to login with google username and password
 */
public class GoogleAutoCredentialProvider extends CredentialProvider {

	// from https://github.com/tejado/pgoapi/blob/master/pgoapi/auth_google.py
	private static String GOOGLE_LOGIN_ANDROID_ID = "9774d56d682e549c";
	private static String GOOGLE_LOGIN_SERVICE =
			"audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com";
	private static String GOOGLE_LOGIN_APP = "com.nianticlabs.pokemongo";
	private static String GOOGLE_LOGIN_CLIENT_SIG = "321187995bc7cdc2b5fc91b11a96e2baa8602c62";

	private final Gpsoauth gpsoauth;
	private final String username;
	private Time time;

	@Getter
	private TokenInfo tokenInfo;

	/**
	 * Constructs credential provider using username and password
	 *
	 * @param httpClient OkHttp client
	 * @param username google username
	 * @param password google password
	 * @throws LoginFailedException if an exception occurs while attempting to log in
	 * @throws InvalidCredentialsException if invalid credentials are used
	 */
	public GoogleAutoCredentialProvider(OkHttpClient httpClient, String username, String password)
// Path: library/src/main/java/com/pokegoapi/exceptions/request/InvalidCredentialsException.java
// public class InvalidCredentialsException extends RequestFailedException {
// 	public InvalidCredentialsException() {
// 		super();
// 	}
// 
// 	public InvalidCredentialsException(String reason) {
// 		super(reason);
// 	}
// 
// 	public InvalidCredentialsException(Throwable exception) {
// 		super(exception);
// 	}
// 
// 	public InvalidCredentialsException(String reason, Throwable exception) {
// 		super(reason, exception);
// 	}
// }


// Path: library/src/main/java/com/pokegoapi/auth/GoogleAutoCredentialProvider.java
import POGOProtos.Networking.Envelopes.RequestEnvelopeOuterClass.RequestEnvelope.AuthInfo;
import com.pokegoapi.exceptions.request.InvalidCredentialsException;
import com.pokegoapi.exceptions.request.LoginFailedException;
import com.pokegoapi.util.SystemTimeImpl;
import com.pokegoapi.util.Time;
import lombok.Getter;
import okhttp3.OkHttpClient;
import svarzee.gps.gpsoauth.AuthToken;
import svarzee.gps.gpsoauth.Gpsoauth;
import java.io.IOException;

package com.pokegoapi.auth;



/**
 * Use to login with google username and password
 */
public class GoogleAutoCredentialProvider extends CredentialProvider {

	// from https://github.com/tejado/pgoapi/blob/master/pgoapi/auth_google.py
	private static String GOOGLE_LOGIN_ANDROID_ID = "9774d56d682e549c";
	private static String GOOGLE_LOGIN_SERVICE =
			"audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com";
	private static String GOOGLE_LOGIN_APP = "com.nianticlabs.pokemongo";
	private static String GOOGLE_LOGIN_CLIENT_SIG = "321187995bc7cdc2b5fc91b11a96e2baa8602c62";

	private final Gpsoauth gpsoauth;
	private final String username;
	private Time time;

	@Getter
	private TokenInfo tokenInfo;

	/**
	 * Constructs credential provider using username and password
	 *
	 * @param httpClient OkHttp client
	 * @param username google username
	 * @param password google password
	 * @throws LoginFailedException if an exception occurs while attempting to log in
	 * @throws InvalidCredentialsException if invalid credentials are used
	 */
	public GoogleAutoCredentialProvider(OkHttpClient httpClient, String username, String password)
			throws LoginFailedException, InvalidCredentialsException {