(function(context,$) {

    "use strict";

    context.JK = context.JK || {};
    context.JK.FakeJamClientMessages = function() {

        var self = this;

        function startRecording(recordingId) {
            var msg = {};
            msg.type = self.Types.START_RECORDING;
            msg.msgId = context.JK.generateUUID();
            msg.recordingId = recordingId;
            return msg;
        }

        function startRecordingAck(recordingId, success, reason, detail) {
            var msg = {};
            msg.type = self.Types.START_RECORDING_ACK;
            msg.msgId = context.JK.generateUUID();
            msg.recordingId = recordingId;
            msg.success = success;
            msg.reason = reason;
            msg.detail = detail;
            return msg;
        }

        function stopRecording(recordingId, success, reason, detail) {
            var msg = {};
            msg.type = self.Types.STOP_RECORDING;
            msg.msgId = context.JK.generateUUID();
            msg.recordingId = recordingId;
            msg.success = success === undefined ? true : success;
            msg.reason = reason;
            msg.detail = detail;
            return msg;
        }

        function stopRecordingAck(recordingId, success, reason, detail) {
            var msg = {};
            msg.type = self.Types.STOP_RECORDING_ACK;
            msg.msgId = context.JK.generateUUID();
            msg.recordingId = recordingId;
            msg.success = success;
            msg.reason = reason;
            msg.detail = detail;
            return msg;
        }

        function abortRecording(recordingId, reason, detail) {
            var msg = {};
            msg.type = self.Types.ABORT_RECORDING;
            msg.msgId = context.JK.generateUUID();
            msg.recordingId = recordingId;
            msg.success = false;
            msg.reason = reason;
            msg.detail = detail;
            return msg;
        }

        this.Types = {};
        this.Types.START_RECORDING = 'start_recording';
        this.Types.START_RECORDING_ACK = 'start_recording_ack';
        this.Types.STOP_RECORDING = 'stop_recording;'
        this.Types.STOP_RECORDING_ACK = 'stop_recording_ack';
        this.Types.ABORT_RECORDING = 'abort_recording';

        this.startRecording = startRecording;
        this.startRecordingAck = startRecordingAck;
        this.stopRecording = stopRecording;
        this.stopRecordingAck = stopRecordingAck;
        this.abortRecording = abortRecording;
    }



})(window, jQuery);