/**
 * <p class=proto-main>IVH-In Vehicle Help,This API is to notify when new Help Content is available for download.  The IVH client will manage downloading the update most likely through a different channel (https).</p>
 *
 * <div class=proto-hier>
 *   UconnectAny
 *     |
 *     |---- <a href="#com.fca.uconnect.global.InitiateIVHDiscrepancyCheck">InitiateIVHDiscrepancyCheck </a>
 *     |
 *     |---- <a href="#com.fca.uconnect.global.IVHDiscrepancyCheck">IVHDiscrepancyCheck  </a>
 *     |
 *     |---- <a href="#com.fca.uconnect.global.ContentUpdateNotification">ContentUpdateNotification contentUpdateNotification </a>
 *     |
 *     |---- <a href="#com.fca.uconnect.global.ContentUpdateStatusNotification">ContentUpdateStatusNotification ContentUpdateStatusNotification</a>
 * </div>
 *  <h3 class=change-log-hdr> Change Log</h3>
 *  <table id="change-log" class="change-log"><thead><tr>
 *	<td>Version</td><td>Date</td><td>Notes</td></tr></thead>
 *   <tbody>
  *    <tr><td>1.2</td><td>2017-11-2</td><td>Update to Proto3</td></tr>	
 *	<tr><td>1.0</td><td>2017-10-25</td><td>Release of initial Proto</td></tr>
 *	</tbody></table>
 *
 *  <h3 class=change-log-hdr>List of MQTT Topics</h3>
 *  <table class="change-log"><thead><tr>
 *	<td>Flow</td><td>Type</td><td>Topic Name</td></tr></thead>
 *    <tbody>
 *   <tr><td>Cloud send to Vehicle</td><td>Publish</td><td>fcasdp/${iot:ClientId}/IVH</td></tr>
 *	 <tr><td>Cloud receive from Vehicle</td><td>Subscribe</td><td>fcasdp/IVH/#</td></tr>
 *	 <tr><td>Vehicle send to Cloud </td><td>Publish</td><td>fcasdp/IVH/${iot:ClientId}</td></tr>
 *	 <tr><td>Vehicle receive from Cloud </td><td>Subscribe</td><td>fcasdp/${iot:ClientId}/#</td></tr>
 *	</tbody></table>
 * <h3 class=change-log-hdr>Data Flow</h3>
 *
 * <p class=proto-main>The following sequence diagram depicts the flow of messages between the HU and the SDP:</p>
 *
 * <img class=img-border src=./images/ivh.png>
 *
 * <table class=sequence-table><thead><tr>
 *	<td>Sequence</td><td>Title</td><td>Role</td><td>Message</td><td>Topic</td><td>Description</td></tr></thead>
 *   <tbody>
 * <tr><td>1.1</td><td>Content Update Event</td><td>SDP</td><td></td><td></td><td><p>The ContentUpdate event which triggers the SDP device to send an InitiateDescrepancyCheck message to Client.</p></td></tr>
 * <tr><td>1.2</td><td>Assign MessageId</td><td>SDP</td><td></td><td></td><td><p>The SDP generates the messageId for the message by incrementing a sequence counter.</p></td></tr>
 * <tr><td>2.</td><td>Send InitiateDescrepancyCheck Message</td><td>SDP</td><td>InitiateDescrepancyCheck</td><td>${iot:ClientId}/IVH</td><td><p>The SDP populates the InitiateDescrepancyCheck Message with the required elements and publishes to the IVH topic.</p></td></tr>
 * <tr><td>3.1</td><td>Process Message</td><td>HU</td><td></td><td></td><td><p>The Client process the message, generates an DescrepancyCheck Message with the DRM .</p></td></tr>
 * <tr><td>3.2</td><td>Assign correlationID</td><td>HU</td><td></td><td></td><td><p>Assign correct correlationId.</p></td></tr>
 * <tr><td>4.</td><td>Send DescrepancyCheck Message</td><td>HU</td><td>DescrepancyCheck</td><td>${iot:ClientId}/IVH</td><td><p>The Client populates the DescrepancyCheck Message with the required elements and publishes to the IVH topic.</p></td></tr>
 * <tr><td>5</td><td>Process Message</td><td>HU</td><td></td><td></td><td><p>The Client process the message, generates an DescrepancyCheck Message with the DRM .</p></td></tr>
 * <tr><td>6.</td><td>Send ContentUpdateNotification Message</td><td>SDP</td><td>ContentUpdateNotification</td><td>${iot:ClientId}/IVH</td><td><p>The SDP populates the ContentUpdateNotification Message with the required elements and publishes to the IVH topic.</p></td></tr>
 * <tr><td>7.1.</td><td>Process Message</td><td>HU</td><td></td><td></td><td><p>The Client process the message,verify the update and download it from URL and respond and generates an ContentUpdateStatusNotification Message with the status .</p></td></tr>
 * <tr><td>7.2.</td><td>Assign correlationID</td><td>HU</td><td></td><td></td><td><p>Assign correct correlationId.</p></td></tr>
 * <tr><td>8.</td><td>Send ContentUpdateStatusNotification Message</td><td>HU</td><td>ContentUpdateStatusNotification</td><td>/IVH/${iot:ClientId}</td><td><p>The Client publishes the response message to the IVH topic for the SDP to receive.</p></td></tr>
 * <tr><td>9.1.</td><td>Process Message</td><td>SDP</td><td></td><td></td><td><p>The SDP receives the message and verifies the correlationId matches the messageId of the sent request.</p></td></tr>
 * <tr><td>9.2.</td><td>Assign correlationID</td><td>HU</td><td></td><td></td><td><p>Assign correct correlationId.</p></td></tr>
 * <tr><td>10</td><td>send AckMessage</td><td>SDP</td><td>AckMessage</td><td>/IVH/${iot:ClientId}</td><td><p>The SDP sends AckMessage to acknowledge that it received ContentUpdateStatusNotification.</p></td></tr>
 * <tr><td>11</td><td>Process AckMessage</td><td>HU</td><td></td><td></td><td><p>The client process AckMessage.</p></td></tr>
 *
 * </tbody>
 * </table>
 */
syntax="proto3";
package com.fca.uconnect.global;


//import public "Global_Uconnect_Control.proto";
import public "Global_Uconnect_DRM.proto";
/**
 * This message is for SDP to request HU to initiate DescrepancyCheck for updates.
 * <div class=exmsg-main>
 * <h4>InitiateIVHDescrepancyCheck Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1490885867532
 * 		messageId: 11
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.initiateDescrepancyCheck]
 * 		  {
 *  	  }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
message InitiateIVHDiscrepancyCheck{
 map<string,string> parameters = 1;
}
/**
 * This message is to check if there is an update available for Content.
 */
message IVHDiscrepancyCheck{
 DRM drm = 1; /// DRM file upload for discrepancy Check
}

/**
 * This message is to Push the Help Content to Client when there is an update available.
 * <div class=exmsg-main>
 * <h4>ContentUpdateNotification Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1490885867532
 * 		messageId: 11
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.contentUpdateNotification]
 * 		  {
 * 			version: "2.0"
 * 			description: "Update for ABC"
 * 			expireDate: 360000
 * 			packageSize: 10000
 * 			url: "https://abc.com"
 * 			checksum: "CE114E4501D2F4E2DCEA3E17B546F339"
 *  	  }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
message ContentUpdateNotification{
  string  contentId = 1;///Content identifier which is unique.
  string  version = 2;///Version of the Firmware that needs to be downloaded.
  string  description = 3;///Description to be displayed to the User
  int64   expireDate = 4;///Time till when the Software is available for update.
  int32   packageSize = 5;///Size of the Content.
  string  url = 6;///URL to download the Content update.
  string  checksum = 7;///Checksum of the FW package is to ensure integrity of downloading.
  string  token = 8;///Token which will be sent to download server to download the Content.
}

/**
 * This message is to respond to SDP after Client installs Content Updates.
 *<div class=exmsg-main>
 * <h4>ContentUpdateStatusNotification Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1490885867676
 * 		messageId: 1
 * 		correlationId: 11
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.ContentUpdateStatusNotification]
 * 		 {
 * 			status: SUCCESS
 * 		 }
 * 		}
 *	</code>
 *   </div></div>
 */
message ContentUpdateStatusNotification {

 enum StatusEnum {
			SUCCESS = 0;///Updated Successfully.
			FAILURE = 1;///Download Failed from Download server.
			UPTODATE = 4;/// This Firmware update is already installed.
		}
		 StatusEnum status = 1; /// Indicator for the status of the FirmwareUpdate.
		 bool isTransient = 2; /// Indicates a transient error and a retry can be attempted.
		 int32 failureReasonCode = 3; /// Specific error code.
		 string appId = 4;/// Application ID

}

//extend UconnectAny{
//	 InitiateIVHDiscrepancyCheck initiateIVHDiscrepancyCheck=510;
//	 IVHDiscrepancyCheck ivhDiscrepancyCheck=511;
//	 ContentUpdateNotification contentUpdateNotification=512;
//	 ContentUpdateStatusNotification contentUpdateStatusNotification=513;
	// AckMessage ivhAckMessage=514;
//}

