public Journey AddJourney(Journey journey, List <JourneyAsset> journeyAssets, List <JourneyAssetDriver> journeyAssetDrivers, List <JourneyAssetExternalPassenger> journeyAssetExternalPassengers, JourneyRoute journeyRoute)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.JourneysController.ADDJOURNEY, HttpMethod.Put);

            request.AddJsonBody(journey);
            request.AddJsonBody(journeyAssets);
            request.AddJsonBody(journeyAssetDrivers);
            request.AddJsonBody(journeyAssetExternalPassengers);
            request.AddJsonBody(journeyRoute);
            IHttpRestResponse <Journey> response = Execute <Journey>(request, 1);

            return(response.Data);
        }
        public async Task <Journey> AddJourneyAsync(Journey journey, List <JourneyAsset> journeyAssets, List <JourneyAssetDriver> journeyAssetDrivers, List <JourneyAssetExternalPassenger> journeyAssetExternalPassengers, JourneyRoute journeyRoute)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.JourneysController.ADDJOURNEY, HttpMethod.Put);

            request.AddJsonBody(journey);
            request.AddJsonBody(journeyAssets);
            request.AddJsonBody(journeyAssetDrivers);
            request.AddJsonBody(journeyAssetExternalPassengers);
            request.AddJsonBody(journeyRoute);
            IHttpRestResponse <Journey> response = await ExecuteAsync <Journey>(request, 1).ConfigureAwait(false);

            return(response.Data);
        }
Ejemplo n.º 3
0
        public async Task UpdateDriverExtendedIdAsync(ExtendedDriverIdUpdate driver)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DriversController.UPDATEDRIVEREXTENTEDID, HttpMethod.Put);

            request.AddJsonBody(driver);
            await ExecuteAsync(request).ConfigureAwait(false);
        }
Ejemplo n.º 4
0
        public async Task UpdateDriverAsync(Driver driver)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DriversController.UPDATEDRIVER, HttpMethod.Put);

            request.AddJsonBody(driver);
            await ExecuteAsync(request).ConfigureAwait(false);
        }
        public void Update(Asset asset)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.AssetsController.UPDATE, HttpMethod.Put);

            request.AddJsonBody(asset);
            Execute(request);
        }
        public async Task UpdateAsync(Asset asset)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.AssetsController.UPDATE, HttpMethod.Put);

            request.AddJsonBody(asset);
            await ExecuteAsync(request).ConfigureAwait(false);
        }
        public CreatedSinceResult <HosEvent> GetHosEventDataSince(ParameterEntityType entityTypeId, List <long> entityIds, List <byte> eventTypeIds, string sinceToken)
        {
            var dataRequest = new HosEventDataRequest {
                EntityTypeId = entityTypeId, EntityIds = entityIds, EventTypeIds = eventTypeIds
            };

            IHttpRestRequest request = GetRequest(APIControllerRoutes.HosDataController.GETHOSEVENTDATASINCE, HttpMethod.Post);

            request.AddUrlSegment("sinceToken", sinceToken);
            request.AddJsonBody(dataRequest);

            IHttpRestResponse <List <HosEvent> > response = Execute <List <HosEvent> >(request);

            var sHasMoreItems = GetResponseHeader(response.Headers, "HasMoreItems");
            var getSinceToken = GetResponseHeader(response.Headers, "GetSinceToken");

            if (!bool.TryParse(sHasMoreItems, out var hasMoreItems))
            {
                throw new Exception("Could not read the HasMoreItems header");
            }

            return(new CreatedSinceResult <HosEvent> {
                HasMoreItems = hasMoreItems, GetSinceToken = getSinceToken, Items = response.Data
            });
        }
Ejemplo n.º 8
0
        public void UpdateDriverExtendedId(ExtendedDriverIdUpdate driver)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DriversController.UPDATEDRIVEREXTENTEDID, HttpMethod.Put);

            request.AddJsonBody(driver);
            Execute(request);
        }
Ejemplo n.º 9
0
        public void UpdateDriver(Driver driver)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DriversController.UPDATEDRIVER, HttpMethod.Put);

            request.AddJsonBody(driver);
            Execute(request);
        }
        public async Task <CreatedSinceResult <HosEvent> > GetHosEventDataAsync(ParameterEntityType entityTypeId, List <long> entityIds, List <byte> eventTypeIds, DateTime fromDateTime, DateTime toDateTime)
        {
            var dataRequest = new HosEventDataRequest {
                EntityTypeId = entityTypeId, EntityIds = entityIds, EventTypeIds = eventTypeIds
            };

            IHttpRestRequest request = GetRequest(APIControllerRoutes.HosDataController.GETHOSEVENTDATA, HttpMethod.Post);

            request.AddUrlSegment("from", fromDateTime.ToString(DataFormats.DateTime_Format));
            request.AddUrlSegment("to", toDateTime.ToString(DataFormats.DateTime_Format));
            request.AddJsonBody(dataRequest);

            IHttpRestResponse <List <HosEvent> > response = await ExecuteAsync <List <HosEvent> >(request).ConfigureAwait(false);

            var sHasMoreItems = GetResponseHeader(response.Headers, "HasMoreItems");
            var getSinceToken = GetResponseHeader(response.Headers, "GetSinceToken");

            if (!bool.TryParse(sHasMoreItems, out var hasMoreItems))
            {
                throw new Exception("Could not read the HasMoreItems header");
            }

            return(new CreatedSinceResult <HosEvent> {
                HasMoreItems = hasMoreItems, GetSinceToken = getSinceToken, Items = response.Data
            });
        }
Ejemplo n.º 11
0
        public async Task AddDriverCertificationAsync(long organisationGroupId, DriverCertification driverCertification)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DriverCertificationController.ADDDRIVERCERTIFICATION, HttpMethod.Post);

            request.AddUrlSegment("organisationId", organisationGroupId.ToString());
            request.AddJsonBody(driverCertification);
            await ExecuteAsync(request).ConfigureAwait(false);
        }
Ejemplo n.º 12
0
        public void AddDriverCertification(long organisationGroupId, DriverCertification driverCertification)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DriverCertificationController.ADDDRIVERCERTIFICATION, HttpMethod.Post);

            request.AddUrlSegment("organisationId", organisationGroupId.ToString());
            request.AddJsonBody(driverCertification);
            Execute(request);
        }
        public async Task AddDriverLicenceAsync(long organisationGroupId, DriverLicence driverLicence)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DriverLicenceController.ADDDRIVERLICENCE, HttpMethod.Post);

            request.AddUrlSegment("organisationId", organisationGroupId.ToString());
            request.AddJsonBody(driverLicence);
            await ExecuteAsync(request).ConfigureAwait(false);
        }
Ejemplo n.º 14
0
        public void Update(Location location, long groupId)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.LocationsController.UPDATE, HttpMethod.Put);

            request.AddUrlSegment("groupId", groupId.ToString());
            request.AddJsonBody(location);
            Execute(request);
        }
Ejemplo n.º 15
0
        public async Task UpdateAsync(Location location, long groupId)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.LocationsController.UPDATE, HttpMethod.Put);

            request.AddUrlSegment("groupId", groupId.ToString());
            request.AddJsonBody(location);
            await ExecuteAsync(request).ConfigureAwait(false);
        }
        public void AddDriverLicence(long organisationGroupId, DriverLicence driverLicence)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DriverLicenceController.ADDDRIVERLICENCE, HttpMethod.Post);

            request.AddUrlSegment("organisationId", organisationGroupId.ToString());
            request.AddJsonBody(driverLicence);
            Execute(request);
        }
        /// <summary>
        /// Get journey current ID
        /// </summary>
        /// <param name="journeyIdList">Group identifier</param>
        /// <returns>List of JourneyIds</returns>
        public List <CurrentJourney> GetJourneyCurrentIdList(List <long> journeyIdList)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.JourneysController.GETJOURNEYCURRENTIDLIST, HttpMethod.Post);

            request.AddJsonBody(journeyIdList);
            IHttpRestResponse <List <CurrentJourney> > response = Execute <List <CurrentJourney> >(request);

            return(response.Data);
        }
        public List <MobileUnitConfigurationState> GetConfigurationState(List <long> assetIds)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DeviceConfigController.GETCONFIGURATIONSTATE, HttpMethod.Post);

            request.AddJsonBody(assetIds);
            IHttpRestResponse <List <MobileUnitConfigurationState> > response = Execute <List <MobileUnitConfigurationState> >(request);

            return(response.Data);
        }
        public List <MobileUnitCameraSettings> GetCameraSettings(List <long> assetIds)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DeviceConfigController.GETCAMERASETTINGS, HttpMethod.Post);

            request.AddJsonBody(assetIds);
            IHttpRestResponse <List <MobileUnitCameraSettings> > response = Execute <List <MobileUnitCameraSettings> >(request);

            return(response.Data);
        }
        public async Task <List <MobileUnitCameraSettings> > GetCameraSettingsAsync(List <long> assetIds)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.DeviceConfigController.GETCAMERASETTINGS, HttpMethod.Post);

            request.AddJsonBody(assetIds);
            IHttpRestResponse <List <MobileUnitCameraSettings> > response = await ExecuteAsync <List <MobileUnitCameraSettings> >(request).ConfigureAwait(false);

            return(response.Data);
        }
        public void UpdateAssetRoadworthyCertificateReminder(long organisationId, AssetRoadworthyCertificateReminder assetRoadworthyCertificateReminder)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.RemindersController.ASSETROADWORTHYREMINDERS, HttpMethod.Put);

            request.AddUrlSegment("organisationId", organisationId.ToString());
            request.AddUrlSegment("assetId", assetRoadworthyCertificateReminder.AssetId.ToString());
            request.AddJsonBody(assetRoadworthyCertificateReminder);
            Execute(request);
        }
        public async Task UpdateAssetRoadworthyCertificateReminderAsync(long organisationId, AssetRoadworthyCertificateReminder assetRoadworthyCertificateReminder)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.RemindersController.ASSETROADWORTHYREMINDERS, HttpMethod.Put);

            request.AddUrlSegment("organisationId", organisationId.ToString());
            request.AddUrlSegment("assetId", assetRoadworthyCertificateReminder.AssetId.ToString());
            request.AddJsonBody(assetRoadworthyCertificateReminder);
            await ExecuteAsync(request).ConfigureAwait(false);
        }
        /// <summary>
        /// Adds the journey.
        /// </summary>
        /// <param name="newJourney">The new journey.</param>
        /// <returns></returns>
        public async Task <long> AddJourneyAsync(CreateJourney newJourney)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.JourneysController.ADDJOURNEY, HttpMethod.Put);

            request.AddJsonBody(newJourney);
            IHttpRestResponse <long> response = await ExecuteAsync <long>(request, 1).ConfigureAwait(false);

            return(response.Data);
        }
        /// <summary>
        /// Adds the journey.
        /// </summary>
        /// <param name="newJourney">The new journey.</param>
        /// <returns></returns>
        public long AddJourney(CreateJourney newJourney)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.JourneysController.ADDJOURNEY, HttpMethod.Put);

            request.AddJsonBody(newJourney);
            IHttpRestResponse <long> response = Execute <long>(request, 1);

            return(response.Data);
        }
Ejemplo n.º 25
0
        public Report_FlexibleDriver GetFlexibleDriverScorecard(ReportQuery reportQuery)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.ScoringController.GETFLEXIBLEDRIVERSORECARD, HttpMethod.Post);

            request.AddJsonBody(reportQuery);
            IHttpRestResponse <Report_FlexibleDriver> response = Execute <Report_FlexibleDriver>(request);

            return(response.Data);
        }
Ejemplo n.º 26
0
        public async Task <Report_FlexibleDriver> GetFlexibleDriverScorecardAsync(ReportQuery reportQuery)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.ScoringController.GETFLEXIBLEDRIVERSORECARD, HttpMethod.Post);

            request.AddJsonBody(reportQuery);
            IHttpRestResponse <Report_FlexibleDriver> response = await ExecuteAsync <Report_FlexibleDriver>(request).ConfigureAwait(false);

            return(response.Data);
        }
Ejemplo n.º 27
0
        public Report_FlexibleStandard GetFlexibleStandardScoreReport(ReportQuery reportQuery)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.ScoringController.GETFLEXIBLESTANDARDSCORINGREPORT, HttpMethod.Post);

            request.AddJsonBody(reportQuery);
            IHttpRestResponse <Report_FlexibleStandard> response = Execute <Report_FlexibleStandard>(request);

            return(response.Data);
        }
Ejemplo n.º 28
0
        public async Task <Report_FlexibleStandard> GetFlexibleStandardScoreReportAsync(ReportQuery reportQuery)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.ScoringController.GETFLEXIBLESTANDARDSCORINGREPORT, HttpMethod.Post);

            request.AddJsonBody(reportQuery);
            IHttpRestResponse <Report_FlexibleStandard> response = await ExecuteAsync <Report_FlexibleStandard>(request).ConfigureAwait(false);

            return(response.Data);
        }
Ejemplo n.º 29
0
        public async Task <List <BulkSubmitJourney> > SubmitBulkJourneysAsync(List <long> journeyIds)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.JourneysController.SUBMITBULKJOURNEY, HttpMethod.Post);

            request.AddJsonBody(journeyIds);
            IHttpRestResponse <List <BulkSubmitJourney> > response = await ExecuteAsync <List <BulkSubmitJourney> >(request).ConfigureAwait(false);

            return(response.Data);
        }
        /// <summary>
        /// Get journey current ID asynchronous
        /// </summary>
        /// <param name="journeyIdList">Group identifier</param>
        /// <returns>List of JourneyIds</returns>
        public async Task <List <CurrentJourney> > GetJourneyCurrentIdListAsync(List <long> journeyIdList)
        {
            IHttpRestRequest request = GetRequest(APIControllerRoutes.JourneysController.GETJOURNEYCURRENTIDLIST, HttpMethod.Post);

            request.AddJsonBody(journeyIdList);
            IHttpRestResponse <List <CurrentJourney> > response = await ExecuteAsync <List <CurrentJourney> >(request).ConfigureAwait(false);

            return(response.Data);
        }