/**
 * <p class=proto-main>This API supports the client sending both User and Device identifier and credentials to the SDP. </p>
 * <p class=proto-main> For Users the SDP replies with the login results.  Upon successful login, the SDP will push a provisioning message to the client with personal account settings associated with the provided user identity.
 * The API is also to support a personal account.  The SDP must know the identity of the user prior to delivering personal account data to the vehicle.</p>
 *
 * <p class=proto-main> For vehicle authorization, commmonly referred to as Bootstrap, the vehicle will send an initial auth key consisting of hash of client generated challengekey and a nonce (a trust id to be identified in implementation)
 * and will recieve in return a server challenge key and nonce. These will be used to generate a temporary session key, which when passed to the server will return a valid sessionid. Once received, the valid sessionId should be used in the Uconnect Message.SessionID filed for all future Uconnect Messages
 * until it is refreshed.
 *
 *
 * <div class=proto-hier>
 *  	UconnectAny
 * 		|
 * 		|---- <a href="#com.fca.uconnect.global.LoginRequest">LoginRequest loginRequest (100)</a>
 * 		|
 * 		|---- <a href="#com.fca.uconnect.global.LoginResponse">LoginResponse loginResponse (101)</a>
 * 		|
 * 		|---- <a href="#com.fca.uconnect.global.LogoutRequest">LogoutRequest LogoutRequest (102)</a>
 * 		|
 * 		|---- <a href="#com.fca.uconnect.global.LogoutResponse">LogoutResponse logoutResponse (103)</a>
 *
 *
 * </div>
 *
 *   <h3 class=change-log-hdr> Change Log</h3>
 *  <table id="change-log" class="change-log"><thead><tr>
 *	<th>Version</th><th>Date</th><th>Notes</th></tr></thead>
 *   <tbody>
 * <tr><td>1.9</td><td>2019-05-07</td><td>Added HDMAPS Topic</td></tr>
 * <tr><td>1.8</td><td>2018-05-30</td><td>Added Token Request and Response for Navigation - NavAutheRequest and Response</td></tr>
 * <tr><td>1.7</td><td>2018-05-30</td><td>Added Token Request and Response for Eco Coaching</td></tr>
 * <tr><td>1.6</td><td>2018-03-12</td><td>Removing bootstrap</td></tr>
 * 		<tr><td>1.5</td><td>2017-12-11</td><td>Adding  bootstrap</td></tr>
  *    <tr><td>1.3</td><td>2017-11-2</td><td>Update to Proto3</td></tr>	
 *  	<tr><td>1.2</td><td>2017-09-27</td><td>Update to include responses</td></tr>
 *  	<tr><td>1.1</td><td>2017-03-22</td><td>Session Id is Changed to Bytes</td></tr>
 *	<tr><td>1.0</td><td>2017-02-14</td><td>Release of initial Proto</td></tr>
 *	</tbody></table>
 *
 *  <h3 class=change-log-hdr>List of MQTT Topics For Nav</h3>
 *  <table class="change-log"><thead><tr>
 *	<th>Flow</th><th>Type</th><th>Topic Name</th></tr></thead>
 *    <tbody>
 *   <tr><td>Cloud send to Vehicle</td><td>Publish</td><td>fcasdp/${iot:ClientId}/AUTH/</td></tr>
 *	 <tr><td>Cloud receive from Vehicle</td><td>Subscribe</td><td>fcasdp/AUTH/#</td></tr>
 *	 <tr><td>Vehicle send to Cloud </td><td>Publish</td><td>fcasdp/AUTH/${iot:ClientId}</td></tr>
 *	 <tr><td>Vehicle receive from Cloud</td><td>Subscribe</td><td>fcasdp/${iot:ClientId}/AUTH</td></tr>
 *	</tbody></table>
 *  <h3 class=change-log-hdr>Data Flow</h3>
 *
 * <h3 class=change-log-hdr>List of MQTT Topics For L2+ ADAS</h3>
 *  <table class="change-log"><thead><tr>
 *	<th>Flow</th><th>Type</th><th>Topic Name</th></tr></thead>
 *    <tbody>
 *   <tr><td>Cloud send to Vehicle</td><td>Publish</td><td>fcasdp/${iot:ClientId}/HDMAPS/</td></tr>
 *	 <tr><td>Cloud receive from Vehicle</td><td>Subscribe</td><td>fcasdp/HDMAPS/#</td></tr>
 *	 <tr><td>Vehicle send to Cloud </td><td>Publish</td><td>fcasdp/HDMAPS/${iot:ClientId}</td></tr>
 *	 <tr><td>Vehicle receive from Cloud</td><td>Subscribe</td><td>fcasdp/${iot:ClientId}/HDMAPS</td></tr>
 *	</tbody></table>
 *  <h3 class=change-log-hdr>Data Flow</h3>
 *
 * <p class=proto-main>The following sequence diagram shows the messages for implementing login/logout to support securely accessing the personal account information managed by the SDP:
 * </p>
 *
 * <img class=img-border src=./images/login.png>
 *
 * *
 */
syntax="proto3";
package com.fca.uconnect.global;
import public "Global_Uconnect_Device.proto";

//import public "Global_Uconnect_Control.proto";
/**
 * This is for loginRequest.
 *<div class=exmsg-main>
 *  <h4>Login Request Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1488868820053
 * 		messageId: 1
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.loginRequest]
 * 		 {
 * 			access: BASE
 * 			identifier: "userId"
 * 			credentials: "Transformed(Pwd)"
 * 		 }
 * 		}
 *	</code>
 *   </div></div>
 */

message NavAuthRequest{
	// string deviceID = 1; /// Device ID Required for Token from Nav Provider
	bytes token = 2; /// Use for Token Refresh Requests
	NavAuthResponse.ProviderId provider = 3; /// ProviderID



}

message servicesList {
	string serviceID = 1;
}
message NavAuthResponse {

	enum ResponseEnum {
		SUCCESS = 0; /// Success
		NOT_AUTHORIZED = 1; /// NOT_AUTHORIZED
		FAILURE = 2; /// FAILURE
	}


	 ResponseEnum response = 5;
	 bytes sessionId = 2; /// Session ID for the current login
	 bool isTransient = 3; /// Indicates a transient error and a retry can be attempted.
	 int32 failureReasonCode = 4; /// Specific error code.
	 bytes tokenFile = 1; /// Use for token, or for Tom Tom the XML including token and services
	 repeated servicesList ServiceIDs = 6;
	 string tokenExpiration = 7;
	 ProviderId providerEnum = 8;


	enum ProviderId {
	TOMTOM = 0;
	TELENAV = 1;
}


}

message ProfileTokenRequest {
	string userName = 1;/// Username for Eco Coaching
	bytes credential = 2; /// Credential for Eco Coaching, should be encrypted

}

message ProfileTokenResponse {
	enum ResponseEnum {
		SUCCESS = 0; /// Success
		NOT_AUTHORIZED = 1; /// NOT_AUTHORIZED
		FAILURE = 2; /// FAILURE
	}

	 ResponseEnum response = 1;
	 bytes sessionId = 2; /// Session ID for the current login
	 bool isTransient = 3; /// Indicates a transient error and a retry can be attempted.
	 int32 failureReasonCode = 4; /// Specific error code.
	 bytes profileToken = 5; /// Returned Profile Token

}
message LoginRequest {


	enum AccessLevelEnum {
		BASE = 0; /// Base Enumeration
		PIN_AUTHORIZED = 1; /// Pin Authorized
		TOKENAUTHORIZED = 2; /// For Eco Coaching Profiles
			}

	 AccessLevelEnum access = 1;///Is this initial login or a pin authorized login.
	 string identifier = 2;/// Login Id for current user.
	 string credentials = 3;/// Password for current user
	 bytes token = 4;	///For passing authorization tokens
	 }
/**
 * This is for loginResponse.
 * <div class=exmsg-main>
 * <h4>Login Response Example Message:</h4>
 *  <div class=ex-msg>
 *	<code>
 *		timestamp: 1488868821160
 * 		messageId: 1
 * 		correlationId: 1
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.loginResponse]
 * 		 {
 * 			response: SUCCESS
 * 			sessionId: "-\0274\302]\325\324 \354K"
 * 		 }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
message LoginResponse {

	enum ResponseEnum {
		SUCCESS = 0; /// Success
		NOT_AUTHORIZED = 1; /// NOT_AUTHORIZED
		FAILURE = 2; /// FAILURE
	}	

	 ResponseEnum response = 1;
	 bytes sessionId = 2; /// Session ID for the current login
	 bool isTransient = 3; /// Indicates a transient error and a retry can be attempted.
	 int32 failureReasonCode = 4; /// Specific error code.
}
/**
 * The LogoutRequest has no data elements.
 * <div class=exmsg-main>
 * <h4>LogoutRequest Example Message:</h4>
 *  <div class=ex-msg>
 *	<code>
 * 		timestamp: 1488869130664
 * 		messageId: 20
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.logoutRequest]
 * 		 {
 * 		 }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
message LogoutRequest {

}
/**
 * This will be response to LogoutRequest.
 * <div class=exmsg-main>
 * <h4>LogoutResponse Example Message:</h4>
 *  <div class=ex-msg>
 *	<code>
 *		timestamp: 1488869130739
 * 		messageId: 22
 * 		correlationId: 20
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.logoutResponse]
 * 		 {
 * 			response: SUCCESS
 * 		 }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
message LogoutResponse {
	enum LogoutResponseEnum {
		SUCCESS = 0; /// Success
		FAILURE = 1;/// Failure
	}	

	 LogoutResponseEnum response = 1;///This is an enum which identifies whether logout is successful or has failed.
	 bool isTransient = 2; /// Indicates a transient error and a retry can be attempted.
	 int32 failureReasonCode = 3; /// Specific error code.
}

/**
 * This is for SecondVehicleAuthorizationRequest.
 *<div class=exmsg-main>
 *  <h4>FirstVehicleAuthorization Request Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1488868820053
 * 		messageId: 1
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.FirstAuthorizationResponse]
 * 		 {
 * 			“vin”: “AEEUDHS4857382038”,
 * 			“tuProfile”: {
 * 				“nadimei”: “323232323232”,
 * 				“simMsisdn”: “12123123123”,
 * 				“simIccid”: “12123123123”,
 * 				“imsi”: “12123123123”,
 * 				“tbmSerial”: “JK1212ASD233”,
 * 				“tbmSoftwareVersion”: “17.03.03”
 * 				},
 * 			“tempAuthKey”: “12ABc345”,
 * 			“correlationId”: “12abCd1”
 * 			}
 * 		 }
 * 		}
 *	</code>
 *   </div></div>
 */





