/**
 * <p class=proto-main>This API is to notify the User in case of steal or tamper with car.When Theft alarm is detected Client sends Information to SDP to alert the User.
 * </p>
 *
 * <div class=proto-hier>
 * 	 UconnectAny
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.TheftAlarmNotification">TheftAlarmNotification theftAlarmNotification (210)</a>
 * 	   |
 * 	   |---- <a href="#com.fca.uconnect.global.TheftAlarmNotification">TheftAlarmNotificationResponse theftAlarmNotificationResponse (211)</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.6</td><td>2018-07-23</td><td>Updated Theft Alarm Sequence Diagram</td></tr>
 * <tr><td>1.5</td><td>2018-05-20</td><td>Added TheftAlarmSuppression per assembla ticket 222</td></tr>
 * <tr><td>1.4</td><td>2018-04-30</td><td>Added Battery and Gyro Alarm Causes per Assembla ticket 402</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-08-11</td><td>Added TheftAlarmNotificationResponse.</td></tr>
 *  <tr><td>1.1</td><td>2017-04-18</td><td>Removed TheftAlarmNotificationResponse and moved vehicle status key value to common proto.</td></tr>
 *	<tr><td>1.0</td><td>2017-03-16</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}/TANF</td></tr>
 *	 <tr><td>Cloud receive from Vehicle</td><td>Subscribe</td><td>fcasdp/TANF/#</td></tr>
 *	 <tr><td>Vehicle send to Cloud </td><td>Publish</td><td>fcasdp/TANF/${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>The following sequence diagram depicts the flow of messages between the TBM and the SDP:</p>
 *
 * <img class=img-border src=./images/theftalarm.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.</td><td>TheftAlarm Notification Event</td><td>TBM</td><td></td><td></td><td><p>The in-vehicle TheftAlartm Notification event which triggers the client device to send an TheftAlarm Notification to the SDP.</p></td></tr>
 * <tr><td>2.</td><td>Send TheftAlarmNotification Message</td><td>TBM</td><td>TheftAlarmNotification</td><td>/TANF/${iot:ClientId}</td><td><p>The client populates the TheftAlarmNotification Message with the required elements and publishes to the TheftAlarmNotification topic.</p></td></tr>
 * <tr><td>3.</td><td>Process Message</td><td>SDP</td><td></td><td></td><td><p>The SDP processes the message and and generates an TheftAlarmNotificationResponse Message with the status and the correlationId set to the messageId from the received TheftAlarmNotification Message.</p></td></tr>
 * <tr><td>4.</td><td>Send TheftAlarmNotificationResponse Message</td><td>SDP</td><td>TheftAlarmNotificationResponse</td><td>${iot:ClientId}/TANF</td><td><p>The SDP publishes the response message to the TANF topic for the client to receive.</p></td></tr>
 * <tr><td>5.</td><td>Process Message</td><td>TBM</td><td></td><td></td><td><p>The client receives the message and verifies the correlationId matches the messageId of the sent request.</p></td></tr>
 * <tr><td>Alt_1_1</td><td>TheftAlarmSupressionNotify</td><td>TBM</td><td></td><td></td><td><p>The client Sends a TheftAlarmSuprresionNotify the indicate to the server that there has been a change of status.</p></td></tr>
 * <tr><td>Alt_1_2</td><td>AckMessage</td><td>SDP</td><td></td><td></td><td><p>The server acknowledges receipt of the supression status.</p></td></tr>
 * <tr><td>Alt_1_3</td><td>Process message</td><td>TBM</td><td></td><td></td><td><p>The client receives the message and verifies the correlationId matches the messageId of the sent request.</p></td></tr>
 * <tr><td>Alt_2_1</td><td>TheftAlarmSupressionRequest</td><td>SDP</td><td></td><td></td><td><p>The server Sends a TheftAlarmSuprresionRequest the request the theft alarm be suppressed for the specified period.</p></td></tr>
 * <tr><td>Alt_1_2</td><td>AckMessage</td><td>TBM</td><td></td><td></td><td><p>The client acknowledges receipt of the supression request.</p></td></tr>
 * <tr><td>Alt_1_3</td><td>Process message</td><td>TBM</td><td></td><td></td><td><p>The client receives the message and verifies the correlationId matches the messageId of the sent request.</p></td></tr>
 * </tbody>
 * </table>
 */
 syntax="proto3";
package com.fca.uconnect.global;
// import public "Global_Uconnect_Control.proto";
import public "Global_Uconnect_VehicleInfo.proto";
/**
 * This message represents  TheftAlarmNotification in case of any theft or Tamper with Vehicle.
 * <div class=exmsg-main>
 * <h4>TheftAlarmNotification Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 *		timestamp: 1489694193540
 * 		messageId: 1
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.theftAlarmNotification]
 * 		 {
 * 		  vehicleLocation
 *		  {
 * 			longitude: 43.9999
 * 			latitude: -84.54636
 * 		  }
 * 		 alarmCause
 * 		 {
 * 			isFLDoorBreached: true
 * 			isVehiclePositionChanged: true
 * 		 }
 * 		alarmStatusEnum: ACTIVE
 * 		timeStamp: 1489694193538
 * 	   }
 *    }
 *	</code>
 *   </div>
 * </div>
 */
message TheftAlarmNotification {
	enum AlarmStatusEnum {
		ACTIVE=0;
		INACTIVE=1;
	}
	 Location vehicleLocation = 1;///Location of the Vehicle.
	 AlarmCause alarmCause =2;///This defines the Alarm cause.
	 AlarmStatusEnum alarmStatusEnum =3;///This defines whether Alarm is ACTIVE or INACTIVE.
	 int64 timeStamp = 4;///The milliseconds since (Jan 1, 1970 00:00:00 UTC) when the message is created. Should come from the system clock of the sender.
	 VehicleStatus vehicleStatus = 5;///Status of each door/window/hood/trunk
	message AlarmCause{
		 bool isFLDoorBreached=1;
		 bool isFRDoorBreached=2;
		 bool isRLDoorBreached=3;
		 bool isRRDoorBreached=4;
		 bool isTrunkBreached=5;
		 bool isVehiclePositionChanged=6;
		 bool isGlassBreached=7;
		 bool isBatteryDisconnect = 8; // Required where applicable
		 bool isOverAccelerationThreshold = 9; /// Required where applicable
		 bool isVehicleAlarmSystem = 10; /// Required where applicable

	}
}
message TheftAlarmNotificationResponse{
	 TheftAlarmResponseEnum response = 1;
	enum TheftAlarmResponseEnum{
		SUCCESS = 0;
		FAILURE = 1;

	}
}

message TheftAlarmSuppressionRequest {
	bool suppressAlarm = 1; /// Temporarily Suppress the Theft Alarm Notification
	DurationEnum suppressDuration = 2; /// Configured or selected duration of the suppression

	enum DurationEnum {
		TWOHOURS = 0;
		FOURHRS = 1;
		TWELVEHRS = 2;
		TWENTYFOURHRS = 3;
		THREEDAYS = 4;
		SEVENDAYS = 5;
	}
}

message TheftAlarmSuppressionNotify {
	SupressionStateEnum suppressionState = 1; /// Temporarily Suppress the Theft Alarm Notification
	int64 suppressDuration = 2; /// Configured or selected duration of the suppression


	enum SupressionStateEnum {
		Not_Supressed = 0; /// Alarm notification is active
		Suppressed = 1; /// Alarm notification suppressed
	}
}
//extend UconnectAny {
//     TheftAlarmNotification theftAlarmNotification = 210;
//     TheftAlarmNotificationResponse theftAlarmNotificationResponse = 211;
// }
