public Task <ICollection <LogMessage> > GetLogging([Required] string loglevel, [FromUri] string from = null, [FromUri] string through = null)
        {
            if (string.IsNullOrEmpty(loglevel))
            {
                throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Should supply loglevel value"));
            }

            return(TrboPortalHelper.GetLoggingAsync(loglevel, from, through));
        }
        public Task UpdateRadioSettings([FromBody][Required] IEnumerable <Radio> radioSettings)
        {
            if (radioSettings == null || !radioSettings.Any())
            {
                var message = "RadioSettings need to be supplied";
                throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, message));
            }

            return(TrboPortalHelper.UpdateRadioSettingsAsync(radioSettings));
        }
        public Task SetSystemSettings([FromBody][Required] SystemSettings settings)
        {
            if (settings == null)
            {
                var message = "Settings need to be supplied";
                throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, message));
            }

            return(TrboPortalHelper.UpdateSystemSettingsAsync(settings));
        }
        public Task <ICollection <GpsMeasurement> > GetGpsHistory([FromUri] IEnumerable <int> id, [FromUri] string from, [FromUri] string through)
        {
            var f = DateTimeMapper.ToDateTime(from);
            var t = DateTimeMapper.ToDateTime(through);

            if (f.HasValue && t.HasValue && f > t)
            {
                var message = "From need to be before through";
                throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, message));
            }


            return(TrboPortalHelper.GetGpsMeasurementsAsync(id, f, t));
        }
 public Task <ICollection <GpsMeasurement> > GetMostRecentGps([FromUri] IEnumerable <int> ids)
 {
     return(TrboPortalHelper.GetGpsMeasurementsAsync(ids, null, null));
 }
 public Task <SystemSettings> GetSystemSettings()
 {
     return(TrboPortalHelper.GetSystemSettings());
 }