/**
 *  <script type="text/javascript" src="rawdeflate.js"></script>
 * <script type="text/javascript" src="jquery.js"></script>
 * <script type="text/javascript" src="jquery_plantuml.js"></script>
 *
 *  <p class=proto-main>This API supports the In-Vehicle Activation process by submitting a request to the SDP when the vehicle is first activated by the customer.</p>
 *
 * <div class=proto-hier>
 *   UconnectAny
 *     |
 *     |---- <a href="#com.fca.uconnect.global.ActivationRequest">ActivationRequest activationRequest (120)</a>
 *     |
 *     |---- <a href="#com.fca.uconnect.global.CreatePin">CreatePin createPin (514)</a>
 *     |---- <a href="#com.fca.uconnect.global.ValidatePin">ValidatePin ValidatePin (515)</a>
 *      *     |---- <a href="#com.fca.uconnect.global.LegalDocuments">CompleteActivationRequest CompleteActivationRequest (516)</a>
 *     |---- <a href="#com.fca.uconnect.global.ActivationResponse">ActivationResponse activationResponse (121)</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.9</td><td>2018-12-11</td><td>Added documnetLanguage to the Documents object</td></tr>
 * <tr><td>1.8</td><td>2018-09-25</td><td>Added ACTIVATION_IN_PROGRESS to responseEnum and update diagram and added update TC&C</td></tr>
 * <tr><td>1.7</td><td>2018-09-22</td><td>Merged CompleteActivation with PIN Create and T&C</td></tr>
  *  <tr><td>1.6</td><td>2018-05-22</td><td>Added Enumeration, Legal Docs Needed, Added CompleteActivationRequest, Added LegalDocument ID</td></tr>
  * <tr><td>1.5</td><td>2018-05-22</td><td>Updated Sequence Diagram and added additional requests for CreatePin, ValidatePin and LegalDocument Agreements</td></tr>
  *    <tr><td>1.4</td><td>2017-11-2</td><td>Update to Proto3</td></tr>	
 *  <tr><td>1.3</td><td>2017-09-27</td><td>Update Response for error handling.</td></tr>
 *  <tr><td>1.2</td><td>2017-06-20</td><td>Added mobileDevicePhoneNumber to Activation Request.</td></tr>
 *  <tr><td>1.1</td><td>2017-03-25</td><td>Added Country and Language</td></tr>
 *	<tr><td>1.0</td><td>2017-02-15</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}/UACT</td></tr>
 *	 <tr><td>Cloud receive from Vehicle</td><td>Subscribe</td><td>fcasdp/UACT/#</td></tr>
 *	 <tr><td>Vehicle send to Cloud </td><td>Publish</td><td>fcasdp/UACT/${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 Vehicle and the SDP:</p>
 *
 *
 * <img class=img-border src=./images/activation.png>
*
*
 *
 *
 */
syntax="proto3";
package com.fca.uconnect.global;


//import public "Global_Uconnect_Control.proto";
/**
 * This message represents  Activation request of vehicle for services and other configurations.
 * <div class=exmsg-main>
 * <h4>Activation Request Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1488574019636
 * 		messageId: 1
 * 		messages
 * 	    {
 * 		 [com.fca.uconnect.global.activationRequest]
 * 		 {
 * 			vehicleId: "123456"
 * 			firstName: "abc"
 * 			lastName: "xyz"
 * 			emailAddress: "abc@fca.com"
 * 			tcIndicator: AGREE
 * 		 }
 * 		}
 *	</code>
 *   </div>
 * </div>
 */
message ActivationRequest {
	///Plan to extend this as we get more requirements.

	 string vehicleId = 1; /// Unique ID for the Vehicle. This is either the VIN or an abstracted ID correalating to the VIN in back office
	 string firstName=2; /// First name of the person for whom services are to be activated.
     string lastName=3;  /// Last name of the person for whom services are to be activated.
     string emailAddress=4; /// Email address of the person for whom services are to be activated.
     string language = 6;/// The values shall be formatted according to the ISO alpha-3/639.2 standard.
     string country = 7;/// The values shall be formatted according to the ISO Alpha-2 standard.
     string mobileDevicePhoneNumber = 8;/// An alternative to emailAddress for an out of band channel to communicate activation details to the user.
}

message CreatePin {
	bytes pin = 1;
	bytes confirmPin= 2;
}

message ValidatePin {
	bytes pin = 1;
	ActivationRequest accountValidation = 2; ///

}


message CompleteActivationRequest {
	CreatePin createPin = 4;
	bytes pin = 2; /// Deprecated
	ActivationRequest activationRequestData = 3; /// resend Activation Request Info
	repeated LegalDocuments legalDocuments = 1;
}

message LegalDocuments {
	string documentID = 3; /// Document Identification
	TCIndicatorEnum tcIndicator =1; /// Affirmation by the Telematics Unit that the person for whom services are to be activated has accepted a Terms and Conditions document.
	TCIndicatorEnum privacyAgreemeent =2; /// Affirmation of the Privacy agreement for EMEA Customers

	enum TCIndicatorEnum{
	    DISAGREE=0;///User did not agree.
		AGREE=1;/// User agreed.
}

}

message PinResponse {
	PinStatusEnum PinStatus = 1; /// Used only with ValidatePin

	enum PinStatusEnum {
		PIN_CREATED=0; /// A Pin was successfully created and a new account now exists - Deprecated
		PIN_VALID =1; /// The Pin for the existing account was validated
		PIN_INVALID=2; /// The supplied PIN was invalid
		PIN_NOT_CREATED = 3; /// Failed to create the new Pin and account -  Deprecated
		ACCOUNT_LOCKED = 4; /// Too many failed attempts at Pin validation the use account is locked

	}
}


/**
 * This message is in response to  ActivationRequest.
 *<div class=exmsg-main>
 * <h4>Activation Response Example Message:</h4>
 * <div class=ex-msg>
 *	<code>
 * 		timestamp: 1488740988983
 * 		messageId: 2
 * 		correlationId: 1
 * 		messages
 * 		{
 * 		 [com.fca.uconnect.global.activationResponse]
 * 		 {
 * 			responseEnum: ACTIVATED
 * 		 }
 * 		}
 *	</code>
 *   </div></div>
 */
message ActivationResponse {

 enum ResponseEnum {
			ACTIVATED=0;/// Activated successfully. Set Only After CompleteActivationRequest is sent
			REGISTRATION_REQUIRED=1;///Registration required for Activation - Please Create PIN with CompleteActivation
			FAILURE=2;///Failed due to system exception.
			VALIDATE_PIN = 3; /// Deprecated
			SIGN_LEGAL = 4; /// Deprecated
			COMPLETE_ACTIVATION = 5; /// An Account Exists, submit CompleteActivationRequest - No pin required
			ACTIVATION_IN_PROGRESS = 6; /// For China - RNR Requires completion. Provisioning will be completed after the RNR is done.


		}
		 ResponseEnum response = 1; /// Indicator of the status of the associated ActivationRequest. The correlationId in the containing UconnectMessage must be the same as the messageId of the ActivationRequest.
		 bool isTransient = 2; /// Indicates a retry can be attempted.
		 int32 failureReasonCode = 3; /// Specific Error Code
}

message UpdateLegalDocs {
	repeated LegalDocsDetailType legalDocs = 1; /// Used to send update legal documents to the client. This can include T&C\n Or Privacy Agreements

	message LegalDocsDetailType {
		string documentID = 1;
		string documentVersion = 2;
		string documentLanguage = 3;



	}
	}

message LegalDocsPublish {
	repeated LegalDocs legalDocs = 1;

}
message LegalDocs {
		string documentID = 1;
		string documentVersion = 2;
		bytes document = 3;
		}



//extend UconnectAny{
	 //ActivationRequest activationRequest=120;
	 // ActivationResponse activationResponse=121;
// }

