/**
 * <p class=proto-main>This API enables the SDP to send messages to HU , the HU messages that should be displayed to the operator of the vehicle, and the HU to notify the SDP when messages were displayed and the operator's response.
 * </p>
 *
 * <div class=proto-hier>
 * 	 UconnectAny
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.VehicleMessagePublish">VehicleMessagePublish (1610)</a>
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.VehicleMessageAck">VehicleMessageAck (1611)</a>
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.VehicleMessageDispositionPublish">VehicleMessageDispositionPublish (1612)</a>
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.VehicleMessageDispositionAck">VehicleMessageDispositionAck (1613)</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.5</td><td>2019-07-22</td><td>Provided Support for Flexible messaging per V2C-38 and 40</td></tr>

 * <tr><td>1.5</td><td>2019-07-22</td><td>Provided Support for Flexible messaging per V2C-38 and 40</td></tr>

 * <tr><td>1.5</td><td>2019-07-07</td><td>Update for custom messages per V2C-38</td></tr>

 * <tr><td>1.4</td><td>2018-08-17</td><td>Removed Enrollment Message Type, Added Subscription Message Type, Added Enumeration for Expired Notice, fixed Vehicle Received Topic</td></tr>
 * <tr><td>1.3</td><td>2018-05-17</td><td>Added Enrollment Message Type</td></tr>
 *    <tr><td>1.2</td><td>2017-11-2</td><td>Update to Proto3</td></tr>
 *  <tr><td>1.1</td><td>2017-08-10</td><td>Added VehicleMessageDispositionAck message</td></tr>
 *	<tr><td>1.0</td><td>2017-03-28</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}/IVM</td></tr>
 *	 <tr><td>Cloud receive from Vehicle</td><td>Subscribe</td><td>fcasdp/IVM/#</td></tr>
 *	 <tr><td>Vehicle send to Cloud </td><td>Publish</td><td>fcasdp/IVM/${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/vehiclemessaging.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>Vehicle Messaging Event</td><td>SDP</td><td></td><td></td><td><p>The vehicle messaging event which triggers the SDP  to send an VehicleMessagePublish Message to the 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 style=word-break:break-word;>Send VehicleMessagePublish Message</td><td>SDP</td><td>VehicleMessagePublish</td><td>${iot:ClientId}/IVM</td><td><p>The SDP populates the VehicleMessagePublish Message with the  elements and publishes to the In Vehicle Messaging topic.</p></td></tr>
 * <tr><td>3.1</td><td>Process Message</td><td>HU</td><td></td><td></td><td><p>The HU processes the message and generates an VehicleMessageAck Message with the status</p></td></tr>
 * <tr><td>3.2</td><td>Assign CorrelationID</td><td>HU</td><td></td><td></td><td><p>The correlationId set to the messageId from the received VehicleMessagePublish Message.</p></td></tr>
 * <tr><td>4</td><td>Send VehicleMessageAck Message</td><td>HU</td><td>VehicleMessageAck</td><td>/IVM/${iot:ClientId}</td><td><p>The Client publishes the Acknowledge message to the In Vehicle Messaging topic for the SDP to receive.</p></td></tr>
 * <tr><td>5.</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>6.</td><td style=word-break:break-word;>Send VehicleMessageDispositionPublish Message</td><td>HU</td><td><p>VehicleMessageDispositionPublish</td><td>/IVM/${iot:ClientId}</td><td>The Client publishes the VehicleMessageDispositionPublish message to the In Vehicle Messaging topic for the SDP to receive.</p></td></tr>
 * <tr><td>7.</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 initially sent request.</p></td></tr>
 * <tr><td>8.</td><td>Send VehicleMessageDispositionAck Message</td><td>SDP</td><td>VehicleMessageDispositionAck</td><td>${iot:ClientId}/IVM</td><td><p>The SDP acknowledges the VehicleMessageDispositionAck Message with the  elements and publishes to the In Vehicle Messaging topic.</p></td></tr>
 * <tr><td>9</td><td>Process Message</td><td>HU</td><td></td><td></td><td><p>The HU processes the message.</p></td></tr>
 * </tbody>
 * </table>
 *
 *
 */
 syntax="proto3";
package com.fca.uconnect.global;
//import public "Global_Uconnect_Control.proto";
/**
 * This message is to send any Alert Messages to the Vehicle like Service or Recall.
 * <div class=exmsg-main>
 * <h4>VehicleMessagePublish Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1490983981881
 * 		messageId: 11
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.vehicleMessagePublish]
 * 		 {
 * 		   vin: "1HGCM82633A004352"
 * 		   messageType: SERVICE_NOTICE
 * 		   message
 * 		   {
 * 			language: "ENGLISH"
 * 			messageText: "Your Vehicle is Due for Service"
 * 			}
 * 		 }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
 message VehicleMessagePublish {
	enum MessageType {
		RECALL_NOTICE   = 0; /// Represents Recall Notice Message.
		SERVICE_NOTICE  = 1;/// Represents Service Notice Message.
		PC_NOTIFICATION = 2;/// Represents Parental Control Notification Message.
		ENROLLMENT = 3; /// Represents a Welcome or other Enrollment Message
		SUBSCRIPTION_NOTICE = 4; /// SUBSCRIPTION MESSAGE
		MARKETING = 5; /// Future Use
		GENERAL = 6; /// General Use Messages
		CUSTOM_NOTICE = 7;
	}
	enum MessageDetailType{
		RECALL_ID = 0; ///NOT USED
		RECALL_COMPONENT = 1; ///NOT USED
		RECALL_SUMMARY = 2;
		RECALL_CONSEQUENCE = 3; ///NOT USED
		OWNER_NEXT_STEPS = 4;
		SERVICE_DUE_DATE = 5;  ///NOT USED
		SERVICE_SUMMARY =7;
		SUBSCRIPTION_TO_EXPIRE = 6;
		SUBSCRIPTION_EXPIRED = 8;
		OTHER = 9;
		SUBSCRIPTION_END_DATE = 10;
		SUBSCRIPTION_TO_RENEW = 11;
		SUBSCRIPTION_DAYS_TO_EXPIRE = 12;
		SERVICE_OIL = 13;
		SERVICE_TPM = 14;
		SERVICE_BRAKE = 15;
		SERVICE_BATTERY = 16;
		SUBSCRIPTION_ENDING_SOON = 17;
		SUBSCRIPTION_ENROLL_REMINDER = 18;
		MARKETING_MESSAGE_GENERA =19;
		LEASE_LOYALTY = 20;
		AUDIO_SUBSCRIPTION = 21;




	}
	enum MessagePriorityType{
		PRIORITY_DEFAULT = 0;
		HIGHEST = 1;
		HIGH = 2;
		MEDIUM = 3;
		LEAST = 4;


	}

	enum ButtonActions {
		  NONE = 0;
		  OK =1;
		  REMIND_ME_LATER =2;
		  CALL = 3;
		  BLUETOOTH_CALL =4;
		  OPEN_MAILBOX =5;


	}
	message LanguageString {
		 string title = 3;  
		 string language = 1; /// The language this text is for messages and uses ISO-639-1 Language Code
		 string messageText = 2; /// the text in the given language
		repeated ButtonActions buttonAction = 4; // Repeat up to twice
		string altPhoneNumber = 5;
	}
	 int32 vehicleMessageID = 1; /// Generated by the ICT Back Office
	 string vin = 2;
	 MessageType messageType = 3;
	 MessageDetailType messageDetailType = 7; /// Additional Message Type details
	 string messageTemplate = 4; /// the template to be used to format the message
	 MessagePriorityType messagePriority = 9;

	repeated LanguageString message = 5; /// the message, in the languages that are supported by the device that will display the messages. Languages sent will vary with regional requirements.
	string ServiceMessageEventID = 8; /// MessageEventID for tracking purposes uses the DTC Event Code
	map<string,string> messageParameters = 6;

}





/**
 * This message is to Acknowledge SDP for  VehicleMessagePublish Message.
 * <div class=exmsg-main>
 * <h4>VehicleMessageAck Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1490983982096
 * 		messageId: 1
 * 		correlationId: 11
 * 		messages
 * 		{
 * 		  [com.fca.uconnect.global.vehicleMessageAck]
 * 		  {
 * 			vehicleMessageID: 1
 * 			messageReceiptTimestamp: 1490983982095
 * 			status: MESSAGE_STAGED_FOR_DISPLAY
 * 		  }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
 message VehicleMessageAck {
	enum ResponseEnum {
		MESSAGE_STAGED_FOR_DISPLAY = 0; /// The HU has successfully passed the message to the next downstream component, and is waiting for a reponse
		MESSAGE_TYPE_NOT_SUPPORTED = 1; /// The HU has the message, but cannot process messages of that type. The message is discarded, retry is unlikely to succeed
		MESSAGE_LANGUAGES_NOT_SUPPORTED = 2; /// None of the languages in which the message was furnished can be displayed by the HMI. The message is discarded
		MESSAGE_STAGING_FAILED = 3; /// The HU attempted to stage the message for display, but failed for an unexpected reason. The message is discarded, the SDP should examine the diagnostic to determine whether to resend
		MESSAGE_DESTINATION_TEMPORARILY_NOT_AVAILABLE = 4; /// The HU attempted to stage the message for display, but failed with a diagnostic that the destination ECU is absent. The message is discarded on the HU, and may be sent again.
		MESSAGE_VIN_NOT_VALID = 5; /// The message was discarded because the VIN attached to the HU is not the VIN in the message.
		MESSAGE_AUTO_DELETE = 6; /// Message is removed by the system
		MESSAGE_DELETE = 7; /// Message removed by user
	}
	 int32 vehicleMessageID = 1;
	 int64 messageReceiptTimestamp = 2; /// Time the message was received by the App
	 ResponseEnum status = 3;
	 string failureDiagnostic = 4; /// for MESSAGE_STAGING_FAILED, any status message or result codes may be sent here
}

/**
 * The message has been fully processed, the HU has purged it fully.
 * <div class=exmsg-main>
 * <h4>VehicleMessageDispositionPublish Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1490983992118
 * 		messageId: 2
 * 		correlationId: 11
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.vehicleMessageDispositionPublish]
 * 		 {
 * 		  vehicleMessageID: "\275\237d\235u\350\323\021\212l\002o\247
 * 							\036\007\031!\251\001\316"
 * 		  messageDisplayTimestamp: 1490983982111
 * 		  messageHMIDispositionEventTimestamp: 1490983992116
 * 		  disposition: MESSAGE_DISPLAY_CANCELLED
 * 		 }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
 message VehicleMessageDispositionPublish {
	enum MessageDispositionEnum {
		MESSAGE_CONFIRMED_BY_OPERATOR = 0; /// The message has been shown, and the operator has acknowledged by pressing OK.
		MESSAGE_DISPLAY_CANCELLED = 1; /// The HMI element displaying the message was closed by the operator by pressing X.
		MESSAGE_DISPLAY_CONFIRMED_CALL = 6;/// The message has been shown and the operator pressed the call button.
		MESSAGE_VIN_NOT_VALID = 2; /// The message was not displayed because the vin in VehicleMessagePublish is not the vin attached to the HU or the display ECU. Implies that the VIN has changed.
		MESSAGE_TIMED_OUT = 3; /// logic in the HU or a downstream component has determined that the message is too old to display
		MESSAGE_LANGUAGES_NOT_SUPPORTED = 4; /// None of the languages in which the message was furnished can be displayed by the HMI.
		MESSAGE_DISPLAY_FAILED = 5; /// logic in the HU or a downstream component has discarded the message for an unexpected reason.
		MESSAGE_AUTO_DELETE = 7;/// Message is removed by the system
		MESSAGE_DELETE = 8; /// Message removed by user
	}
	 int32 vehicleMessageID = 1;
	 int64 messageDisplayTimestamp = 2; /// time the message was shown, or VIN change detected
	 int64 messageHMIDispositionEventTimestamp = 3; /// time of operator interaction that closed message display
	 MessageDispositionEnum disposition = 4;
	 string failureDiagnostic = 5; /// for MESSAGE_DISPLAY_FAILED, any status message or result codes may be sent here
	 string vin = 6;
}
/**
 * The message is to acknowledge the  vehicleMessageDispositionPublish message.
 * <div class=exmsg-main>
 * <h4>VehicleMessageDispositionAck Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1490983992220
 * 		messageId: 3
 * 		correlationId: 2
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.vehicleMessageDispositionAck]
 * 		 {
 * 		  response: SUCCESS
 * 		 }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
message VehicleMessageDispositionAck{
	 DispositionResponseEnum response = 1;
	enum DispositionResponseEnum{
		SUCCESS = 0;
		FAILURE = 1;
	}
}
	
//extend UconnectAny {
//     VehicleMessagePublish vehicleMessagePublish = 1610;
//     VehicleMessageAck vehicleMessageAck = 1611;
//     VehicleMessageDispositionPublish vehicleMessageDispositionPublish = 1612;
//      VehicleMessageDispositionAck vehicleMessageDispositionAck = 1613;
// }


