 /**
 * <p class=proto-main>The common proto is utilized to wrap one or more messages in an extensible manner for delivery between the client
 * and services.  This proto also includes common header elements necessary to implement required messaging patterns.</p>
 *
 * <div class=proto-hier>
 * <a href="#com.fca.uconnect.global.UconnectMessage">UconnectMessage (1)</a>
 *
 * <a href="#com.fca.uconnect.global.KeepAliveMessage">KeepAliveMessage (2)</a>
 *
 * <a href="#com.fca.uconnect.global.UconnectAny">UconnectAny (3)</a>
 *
 * <a href="#com.fca.uconnect.global.AckMessage">AckMessage (4)</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.22</td><td>2018-12-20</td><td>Added UploadCoachingDataResponse</td></tr>
* <tr><td>1.22</td><td>2018-09-20</td><td>Added PhoneNumber update requests </td></tr>
 * <tr><td>1.21</td><td>2018-09-06</td><td>Added Added navAuth </td></tr>
 * <tr><td>1.20</td><td>2018-08-04</td><td>Added messages for PHEV and AutoSVL </td></tr>
 *  <tr><td>1.19</td><td>2018-06-04</td><td>Added Privacy Mode Messages </td></tr>
 * <tr><td>1.18</td><td>2018-06-04</td><td>Added PCLogUploads, UpdateRSAPhoneNumbers, Moved CrankInhibit to RemoteInhibitRequest, added VehicleLocationUpdate </td></tr>
 * <tr><td>1.17</td><td>2018-06-04</td><td>Added TheftAlarmSuppression. Added CreatePin, ValidatePin, LegalDocuments for Activation </td></tr>
 * <tr><td>1.16</td><td>2018-04-23</td><td>Removed stolenVehicleControlRequest and Response Messages message</td></tr>
 * <tr><td>1.16</td><td>2018-04-23</td><td>Removed remoteOperationStatus message</td></tr>
 * <tr><td>1.15</td><td>2018-04-19</td><td>Removed cancelRequest message</td></tr>
 * <tr><td>1.15</td><td>2018-03-12</td><td>Added Error Codes table to the Ack Message documentation</td></tr>
 * <tr><td>1.14</td><td>2018-03-12</td><td>Merged Eco Coaching and Brand Pages to make Connected Pages</td></tr>
 * <tr><td>1.13</td><td>2018-03-12</td><td>Added Eco Coaching Message< and split Auth from VehicleAuth/td></tr>
 * <tr><td>1.12</td><td>2017-11-2</td><td>Update to Proto3</td></tr>
 *   <tr><td>1.11</td><td>2017-10-09</td><td>Add apiVersionId to track API version.</td></tr>
 *   <tr><td>1.10</td><td>2017-09-27</td><td>Add isTransient and failureReasonCode to AckMessage.</td></tr>
 *   <tr><td>1.9</td><td>2017-09-20</td><td>Moved Device,VehicleInfo,DRM to Separate proto file.</td></tr>
 *   <tr><td>1.8</td><td>2017-08-07</td><td>Update Location type.</td></tr>
 *   <tr><td>1.7</td><td>2017-07-10</td><td>Added DRM.</td></tr>
 *   <tr><td>1.6</td><td>2017-07-10</td><td>Added additional fields to VehicleStatus.</td></tr>
 *   <tr><td>1.5</td><td>2017-06-30</td><td>Device is added.</td></tr>
 *   <tr><td>1.4</td><td>2017-04-19</td><td>VehicleInfo is added.</td></tr>
 *   <tr><td>1.3</td><td>2017-04-12</td><td>OriginSource , duplicate fields are removed and added estimatedPositionError to location.</td></tr>
 *   <tr><td>1.2</td><td>2017-03-21</td><td>Added Destination.</td></tr>
 *  <tr><td>1.1</td><td>2017-03-02</td><td>Added correlationId, refactored extension mechanism.</td></tr>
 *	<tr><td>1.0</td><td>2016-06-14</td><td>Release of initial Proto</td></tr>
 *	</tbody></table>
 *
 */
syntax="proto3";
package com.fca.uconnect.global;
// import "google/protobuf/any.proto";
import "Global_Uconnect_Ext_SQDF.proto";
import "Global_Uconnect_Ext_VehSync.proto";
import "Global_Uconnect_Ext_Activation.proto";
import "Global_Uconnect_Ext_AOTA.proto";
import "Global_Uconnect_Ext_CommCheck.proto";
import "Global_Uconnect_Ext_Auth.proto";
import "Global_Uconnect_Ext_ECall.proto";
import "Global_Uconnect_Ext_FOTA.proto";
import "Global_Uconnect_Ext_PC.proto";
import "Global_Uconnect_Ext_PHEV.proto";
import "Global_Uconnect_Ext_POISearch.proto";
import "Global_Uconnect_Ext_Provision.proto";
import "Global_Uconnect_Ext_RemoteOp.proto";
import "Global_Uconnect_Ext_RoadSideAssist.proto";
import "Global_Uconnect_Ext_SendAndGo.proto";
import "Global_Uconnect_Ext_Signature.proto";
import "Global_Uconnect_Ext_StolenVehAssist.proto";
import "Global_Uconnect_Ext_TheftAlarmNotify.proto";
import "Global_Uconnect_Ext_VehDataAcquisition.proto";
import "Global_Uconnect_Ext_VehicleFinder.proto";
import "Global_Uconnect_Ext_VehicleMessaging.proto";
import "Global_Uconnect_Ext_WIFIHotSpot.proto";
import "Global_Uconnect_Ext_PerformancePages.proto";
import "Global_Uconnect_Ext_IVH.proto";
import "Global_Uconnect_Ext_ConnectedPages.proto";
import "Global_Uconnect_Ext_VehAuth.proto";
import "Global_Uconnect_Ext_LastMile.proto";
import  "Global_Uconnect_Ext_RemoteInhibits.proto";
import "Global_Uconnect_Ext_PrivacyMode.proto";
import "Global_Uconnect_Ext_Eco_Coaching.proto";

/**
* The UconnectMessage is the top level protocol buffer message for this API and contains header elements that are common to all messages.
*
* Use of correlationId/messageId
* The transport layer between the vehicle and services for the API is MQTT, which supports only the publish/subscribe messaging pattern. MQTT does not have any inherent mechanism for correlating sequences of messages, so the UconnectMessage includes messageId and correlationId attributes for this purpose. 
* While a particular implemenation may make messageId a monotonically increasing unique sequence, it is not a requirement to do so and applications should not count on such behavior. Awareness of how an implementation generates messageId may be helpful for maintenance and debug, but properties such as uniqueness across sessions or application restarts should not be assumed.
*
* Following diagrams are intended as an illustration of the concept of request/response correlation and should not be considered as any kind of suggested application architecture.
*
* The following Diagram depicts how Client should implement Request/Response with messageId/correlationId.
*
* <img class=img-border src=./images/reqresp.png>
*
* The following Diagram depicts how SDP should implement Request/Response with messageId/correlationId.
*
* <img class=img-border style=margin-left:0em; src=./images/reqrespfromsdp.png>
*
* <table class=sequence-table><thead><tr>
* <td>Title</td><td>Description</td></tr></thead>
* <tbody>
* <tr><td>New Request/Response Interaction</td><td><p>The SDP starts new Request Response interaction to a Topic.</p></td></tr>
* <tr><td>Create Interaction Context </td><td><p>The SDP creates Message with required information</p></td></tr>
* <tr><td>newMessageId = nextMessageID()</td><td><p>The SDP generates the messageId for the message by incrementing a sequence counter and assign it to newMessageID</p></td></tr>
* <tr><td>Put(newMessageId,interactionContext)</td><td><p></p></td></tr>
* <tr><td>Create Message</td><td><p>The SDP creates message with interaction context.</p></td></tr>
* <tr><td>message.messageID = newMessageID </td><td><p>Add the newly generated messageId to UconnectMessage.</p></td></tr>
* <tr><td>Publish Message</td><td><p>The SDP publishes the message to MQTT broker topic. </p></td></tr>
* <tr><td>Read Message</td><td><p>The TBM/HU reads the message from subscribed MQTT Broker topic.</p></td></tr>
* <tr><td>Create Response</td><td><p>The TBM/HU creates response message with required information.</p></td></tr>
* <tr><td>response.correlationID=message.messageID</td><td><p>The TBM/HU correlationId set to the messageId from the received  Message.</p></td></tr>
* <tr><td>Publish Response</td><td><p>The TBM/HU publishes response message to MQTT Broker topic.</p></td></tr>
* <tr><td>Read Response</td><td><p>The SDP reads the response message from subscribed MQTT Broker topic.</p></td></tr>
* <tr><td>interactionContext = get(response.correlationID)</td><td><p>The TBM/HU verifies the correlationId matches the messageId of the sent request and assigns received Response to a required message.</p></td></tr>
* <tr><td>process Response</td><td><p>TBM/HU process response message .</p></td></tr>
* <tr><td>delete(response.correlationID)</td><td><p>TBM/HU reads the message from MQTT Broker.</p></td></tr>
* </tbody>
* </table>
*
*  The following Diagram depicts how SDP initiate publish with no response.
*
* <img class=img-border src=./images/pubsubfromsdp.png>
* <table class=sequence-table><thead><tr>
* <td>Title</td><td>Description</td></tr></thead>
* <tbody>
* <tr><td>New Publish Interaction</td><td><p>The SDP starts new Publish interaction to a Topic.</p></td></tr>
* <tr><td>Create Message </td><td><p>The SDP creates Message with required information</p></td></tr>
* <tr><td>message.messageID = 0</td><td><p>The Message id is defaulted to 0 as there is no response and no correlation Id from TBM/HU.</p></td></tr>
* <tr><td>Publish Message</td><td><p>The SDP Publish the message to required Topic through MQTT broker</p></td></tr>
* <tr><td>Read Message</td><td><p>TBM/HU reads the message from MQTT Broker.</p></td></tr>
* </tbody>
* </table>
*/
message UconnectMessage {

    int64 timestamp = 1; ///The milliseconds since (Jan 1, 1970 00:00:00 UTC) when the message is created. Should come from the system clock of the sender.

    bytes sessionId = 2; /// may contain any arbitrary sequence of bytes. Intended for implementations where parties to a session need to share a session identifier. Implementations that do so will be able to use sessionId and messageId to correlate logged messages for diagnostic/debug purposes.

    int32 messageId = 3; /// Assigned to each message by the creator, to allow receivers to reply with correlation. Single node clients can use a per application instance global variable that increments with every message, with a range of -2^31-2^31-1. Clients that are clustered should assign a range of messageIds to each node in the cluster, with the full range equally apportioned.

    int32 correlationId = 4; /// Must only be set from the messageId of a received message. If there is not a received message being responded to, do not set any value other than the default. Initiators of interactions should never set correlationId, it is for point to point request/response only.

//	repeated google.protobuf.Any details = 5;
    repeated UconnectAny messages = 5 ; /// A repeated set of UconnectAny messages supports embedding one or more feature specific messages into a single MQTT message.

    bytes apiVersionId = 6; /// The global api version to provide guidance to the backend for message routing in a multi-version environment.
}

/** KeepAliveMessage provides a lightweight alternative to the base MQTT keep alive provided in the client library.  The message will be used in the scenario where the client manages the keep alive instead of letting the MQTT client manage the keep alive.
 * This is different from original MQTT Keep Alive, imperical testing showed the custom KeepAliveMessage resulted in smaller messages over the network. This is in place as an optional approach to using the default keepalive.
 * KeepAliveMessage should be published on an established system level topic. We recommend 	/fcasdp/${iot:ClientId}/sys/
  */
message KeepAliveMessage {
    int64 timestamp = 1;///The milliseconds since (Jan 1, 1970 00:00:00 UTC) when the message is created. Should come from the system clock of the sender.

}

message AckMessage{
	enum ResponseEnum{
		SUCCESS = 0; ///Success
		FAILURE = 1; /// Failure
	}

	ResponseEnum response = 1; /// Success or Failure
	bool isTransient = 2; /// Indicates if the error is transient and to attempt a retry.
	int32 failureReasonCode = 3; /// App or System Supplied Reason Code for Failures - See Error Codes page in wiki for details


}
/**
 * The UconnectAny message Uses OneOf, so only one message can appear per UconnectAny, the UconnectAny message is repeatable,  so feature specific messages are decoupled from the top level message.  It is a placeholder to allow a repeated set of extensions.
 */
message UconnectAny {
	oneof msg {
     AckMessage ackMessage=1082; /// Ack message definition
	 SQDFPublish sqdfPublish = 1; /// Publish SQDF messages
	 SQDFResponse sqdfResponse = 2; /// SQDF Message Publish Response
	 SQDFRequest sqdfRequest = 3; /// SQDFMessage Request
	 VehicleConfigPublish  vehicleConfigPublish= 1080; /// Publish a Vehicle configuration message
	 VehicleConfigRequest vehicleConfigRequest= 1081; /// Request a vehicle configuration 
     ActivationRequest activationRequest=120; /// Activation Request
	 ActivationResponse activationResponse=121; /// Response to Activation Request
	 InitiateDiscrepancyCheck initiateDiscrepancyCheck=500; /// Initiate a descrepency check
	 DiscrepancyCheck discrepancyCheck=501; /// Descripency Check message
	 ApplicationUpdateNotification applicationUpdateNotification=502; /// Application Update Notification
	 UpdateStatusNotification updateStatusNotification=503; /// Application update status

	 LoginRequest loginRequest = 100; /// Login request
	 LoginResponse loginResponse = 101; /// Response to Login request
	 LogoutRequest logoutRequest = 102; /// Logout request
	 LogoutResponse logoutResponse = 103; /// Response to Logout request

	 VehAuthRequest  vehAuthRequest = 1720; /// First (Bootstrap) Vehicle Authorization Request
	 VehAuthResponse vehAuthResponse = 1721; /// First (Bootstrap) Vehicle Authorization Response

	 CreateTokenRequest createTokenRequest = 1724; /// Request to create an access token
	 CreateTokenResponse createTokenResponse = 1725; /// Access Token response
	 RefreshTokenRequest refreshTokenRequest = 1726; /// Refresh Token Request
	 RefreshTokenResponse refreshTokenResponse = 1727; /// Refresh Token Response, includes new token and refresh token
	 ECallDataUpload ecallDataUpload = 160; /// Data upload for eCall 
     ECallStatusUpdate ecallStatusUpdate = 161; /// ECall Status update
     ECallVehDataRequest ecallVehDataRequest =162; /// vehicle data to publish in Ecall Data upload
     ECallVehDataResponse ecallVehDataResponse = 163; /// response to vehicle data upload (Ack)

	 FirmwareUpdateNotification firmwareUpdateNotification=400; /// Firmware update required notification
	 FirmwareUpdateResponse firmwareUpdateResponse=401; /// Response to firmware update required message (ack)

	  PCUpdateConfigRequest pcUpdateConfigRequest = 1310; /// Parental Controls Configuration Update Request
     PCUpdateConfigResponse pcUpdateConfigResponse = 1311; ///  Response to Parental Controls Configuration Update Request
     PCConfiguredAlertPublish pcAlertPublish = 1312; /// Parental Controls Alert Publish


     // PHEVData  phevData = 2010; /// Publish PHEV China Regulatory data (binary blob)

     POISearchRequest poiSearchRequest=1500; /// Point of Interest Search Request
	 POISearchResponse poiSearchResponse=1501; /// Search Response
	 POISearchDestinationRequest poiSearchDestinationRequest=1502; /// Point of Interest Destination Search
	 POISearchDestinationResponse poiSearchDestinationResponse=1503; /// Destination Search Response
	 InitiateProvisioningPush initiateProvisioningPush = 1010; /// Inititiate a Provisioning Push
     ProvisioningRequest provisioningRequest = 1011; /// Provisioning Request
     ProvisioningResponse provisioningResponse = 1012; /// Response to Provisioning Request
     ProvisioningPush provisioningPush = 1013; /// Provisioning Push
     ProvisioningPushAck provisioningPushAck = 1014; /// Ack for Provision Push request
     RemoteOperationRequest remoteOperationRequest = 320; /// Remote Operations Request 
	RemoteOperationResponse remoteOperationResponse = 321; /// Response for Remote Operations (ack) 

	// CancelRequest cancelRequest = 325; // Cancel remote operation request

	RSADataUpload rsaDataUpload = 180; /// RSA Data
	BCallStatusUpdate bcallStatusUpdate = 181; /// Bcall Status for RoadSideAssist


	DestinationPush destinationPush = 240; /// Send Destination to Vehicle Push
     DestinationPushResponse destinationPushResponse = 241; /// Response for Send Destination to Vehicle
    Signature signature=1001; /// Security Signature
    StolenModeChangeRequest stolenModeChangeRequest = 220; /// SVLA Mode Change
    StolenModeChangeResponse stolenModeChangeResponse= 221; /// Response for SVLA Mode Change Request
    StolenVehicleInfoNotification stolenVehicleInfoNotification= 222; /// SVLA Vehicle info notification


	TheftAlarmSuppressionRequest theftAlarmSupressionRequest = 2016; /// A remote request to suppress the theft alarm notification
	TheftAlarmSuppressionNotify   theftAlarmSupressionNotify = 2017; /// Notification of status to the server when Notification is suppressed from the HMI
    TheftAlarmNotification theftAlarmNotification = 210;/// Theft Alarm Notification
     TheftAlarmNotificationResponse theftAlarmNotificationResponse = 211; /// Response to TAN
      VehicleDataAcquisitionPublish vehicleDataAcquisitionPublish = 200; /// Vehicle Data Acquisition (used in ADA)
	 VehicleDataAcquisitionPolicyPublish vehicleDataAcquisitionPolicyPublish = 250; /// Policy Publish for ADA
	 VehicleLocationRequest vehicleLocationRequest = 1400; /// Vehicle Location Request
     VehicleLocationResponse vehicleLocationResponse= 1401; /// Vehicle Location Response
     VehicleMessagePublish vehicleMessagePublish = 1610; /// Publish Message to Vehicle 
     VehicleMessageAck vehicleMessageAck = 1611; /// Ack for Vehicle Message
     VehicleMessageDispositionPublish vehicleMessageDispositionPublish = 1612; /// disposition for message published to vehicle
      VehicleMessageDispositionAck vehicleMessageDispositionAck = 1613; /// Ack for disposition
       DataPackageStatusRequest dataPackageStatusRequest = 140; /// Data package status request
     DataPackageStatusResponse dataPackageStatusResponse = 141; /// Data package status response
     WifiPackageDataStatus wifiPackageDataStatus =142; /// Wifi Package Data Status
     UploadTrackData uploadTrackData=2000; /// Track data upload for performance pages
      InitiateIVHDiscrepancyCheck initiateIVHDiscrepancyCheck=510; /// Initiate IVH Discrepancy Check
	 IVHDiscrepancyCheck ivhDiscrepancyCheck=511; /// IVH Discrepancy Check
	 ContentUpdateNotification contentUpdateNotification=512; ///Content Update notification
	 ContentUpdateStatusNotification contentUpdateStatusNotification=513; /// Content update status notification
     CommCheckRequest commcheckRequest=1700; /// commcheck Message
     InitiateCommCheck initiateCommCheck=1701; /// Initiate a comm check from server
     CommCheckResponse commCheckResponse=1702; /// commcheck response message
	 UploadPagesData uploadPagesData =256; /// Upload Vehicle Data for Eco Coaching or Brand Pages
	RSAVehicleDataRequest rsaVehicleDataRequest= 2011;
	RSAVehicleDataResponse rsaVehicleDataResponse = 2012;
	LastMilePush lastMilePush = 2013; /// Sends "Last Mile" current and target location data to the SDP
	LastMileResponse lastMileResponse = 2014; /// Response from SDP to LastMilePush
	VehiclePolicyUpdateRequest vehiclePolicyUpdateRequest = 2015; /// Requests an Updated Policy
	CreatePin createPin = 514; /// Creates a PIN for New Activation
	ValidatePin validatePin = 515; /// Validates a PIN for an Existing Account
	LegalDocuments legalDocuments = 516; ///Updates Agreement Status for Legal Documents like T&C and Privacy
	RemoteInhibitRequest remoteInhibitRequest = 2018; /// Remote inhibit request for SVL and FTD
	RemoteInhibitResponse remoteInhibitResponse = 2019; /// Remote Inhibit Response
	CrankAttemptedNotification crankAttemptedNotification = 2020; /// Crank attempted while the vehicle is inhibited
	VehicleLocationUpdate vehicleLocationUpdate = 2021; /// Periodic Update of the Vehicle Location
    UpdateEcallPhoneNumbers updateNumbers= 2022; /// Update the list of numbers for the region. Requires a generic Ack returned
    UpdateRSAPhoneNumbers updateRsaNumbers = 2023; /// Update List of numbers for the RSA
    PCLogUploads pcLogUploads = 2024; /// Upload Logs for Parental Controls
    PrivacyModeRequest privacyModeRequest = 2025; /// Turn on and off Privacy Mode
    PrivacyModeResponse privacyModeResponse = 2026; // Response to privacy mode request
    PrivacyModeNotification privacyModeNotification = 2027;// Notification of active privacy mode initiated in the vehicle
    ChargeNowRequest chargeNowRequest = 2028; /// Request an override to the charge schedule for a PHEV
    ChargeNowResponse chargeNowResponse = 2029; /// Response to ChargeNow Request
    ChargeDataPublish chargeDataPublish = 2030;/// PHEV Vehicle Data Upload
    UpdateChargeSchedule updateChargeSchedules = 2031; /// update the PHEV charge schedules
    InitiateStolenVehicleMode initiateStolenVehicleMode = 2032;/// Informs the SDP that the vehicle has auto-started SVL Mode
    ChargeDataRequest chargeDataRequest = 2033; /// Request a ChargeDataPublish from the vehicle
    CompleteActivationRequest completeActivtationRequest = 2034; /// Return the Legal Documents for Activation
	NavAuthRequest navAuthRequest = 2035;
	NavAuthResponse navAuthResponse= 2036;
	RequestEcallPhoneNumbers requestEcallPhoneNumbers = 2037;
	RequestRSAPhoneNumbers requestRSAPhoneNumbers = 2038;
	UpdateLegalDocs updateLegalDocs = 2039; /// Used to send update legal documents to the client. This can include T&C\n Or Privacy Agreements
	LegalDocsPublish legalDocsPublish = 2040;
	UploadCoachingData uploadCoachingData = 2041;
	UploadCoachingDataResponse uploadCoachingDataResponse = 2044;
	PinResponse pinResponse = 2042;
	VehicleFinderConfig vehicleFinderConfig =2043;

	}
	    }


