├── .gitignore ├── Automile.Net.Tests ├── Automile.Net.Tests.csproj ├── Properties │ └── AssemblyInfo.cs ├── UnitTest1.cs └── packages.config ├── Automile.Net.sln ├── Automile.Net ├── Automile.Net.csproj ├── Automile.Net.nuspec ├── Client │ ├── Contacts.cs │ ├── DeviceEvents.cs │ ├── Devices.cs │ ├── ExpenseReport.cs │ ├── Extensions.cs │ ├── FleetContacts.cs │ ├── FleetVehicles.cs │ ├── Fleets.cs │ ├── Geofence.cs │ ├── HttpClient.cs │ ├── Inspection.cs │ ├── NotificationMessages.cs │ ├── OwnerReport.cs │ ├── Places.cs │ ├── PublishSusbcribe.cs │ ├── TaskMessage.cs │ ├── Tasks.cs │ ├── TokenPair.cs │ ├── Trips.cs │ ├── VehicleGeofences.cs │ ├── VehicleHealth.cs │ ├── VehiclePlaces.cs │ ├── Vehicles.cs │ └── notifications.cs ├── LICENCE.txt ├── Models │ ├── APIAuthorizationModel.cs │ ├── APIClientModel.cs │ ├── AddressModel.cs │ ├── AmbientAirTemperatureModel.cs │ ├── ApiPublishSubscribeAuthenticationType.cs │ ├── ApiPublishType.cs │ ├── ByteArrayConverter .cs │ ├── ChangeUserNameModel.cs │ ├── CompanyContactCreateModel.cs │ ├── CompanyContactDetailModel.cs │ ├── CompanyContactEditModel.cs │ ├── CompanyCreateModel.cs │ ├── CompanyDetailModel.cs │ ├── CompanyEditModel.cs │ ├── CompanyInfoModel.cs │ ├── CompanyModel.cs │ ├── CompanyScopesModel.cs │ ├── CompanyVehicleCreateModel.cs │ ├── CompanyVehicleEditModel.cs │ ├── CompanyVehicleModel.cs │ ├── Contact2CreateModel.cs │ ├── Contact2DetailModel.cs │ ├── Contact2EditModel.cs │ ├── Contact2Model.cs │ ├── ContactCreateModel.cs │ ├── ContactDetailModel.cs │ ├── ContactEditModel.cs │ ├── ContactMeModel.cs │ ├── ContactModel.cs │ ├── ContactVehicleCreateModel.cs │ ├── ContactVehicleDetailModel.cs.cs │ ├── ContactVehicleEditModel.cs │ ├── ContractsModel.cs │ ├── CreateOrderModel.cs │ ├── CreatePINModel.cs │ ├── CustomCategoryModel.cs │ ├── CustomUserCreateModel.cs │ ├── CustomUserCreateWithoutPasswordModel.cs │ ├── DeviceRegisteredModel.cs │ ├── DistanceCodesClearedModel.cs │ ├── DistanceMILOnModel.cs │ ├── EmailExpenseReportModel.cs │ ├── EmailExpenseReportsModel.cs │ ├── EmailTripReportModel.cs │ ├── EngineCoolantTemperatureModel.cs │ ├── ExpenseReportCreateModel.cs │ ├── ExpenseReportCreateModelwImage.cs │ ├── ExpenseReportEditModel.cs │ ├── ExpenseReportModel.cs │ ├── ExpenseReportRowContentCreateModel.cs │ ├── ExpenseReportRowContentCreateModelwImage.cs │ ├── ExpenseReportRowContentEditModel.cs │ ├── ExpenseReportRowContentModel.cs │ ├── ExpenseReportRowCreateModel.cs │ ├── ExpenseReportRowCreateModelwImage.cs │ ├── ExpenseReportRowEditModel.cs │ ├── ExpenseReportRowModel.cs │ ├── FuelLevelInputModel.cs │ ├── GeofenceCreateModel.cs │ ├── GeofenceEditModel.cs │ ├── GeofenceModel.cs │ ├── GeofencePolygon.cs │ ├── GeofenceReportModel.cs │ ├── IMEIConfigCreateModel.cs │ ├── IMEIConfigDetailModel.cs │ ├── IMEIConfigEditModel.cs │ ├── IMEIDeviceType.cs │ ├── IMEIEventDTCModel.cs │ ├── IMEIEventMILModel.cs │ ├── IMEIEventModel.cs │ ├── IMEIEventModelBase.cs │ ├── IMEIEventStatusModel.cs │ ├── ImeiConfigModel.cs │ ├── LeadActivityCreateModel.cs │ ├── LoginModel.cs │ ├── MonitorStatusModel.cs │ ├── MovePushTriggers.cs │ ├── PIDModel.cs │ ├── PlaceCreateModel.cs │ ├── PlaceEditModel.cs │ ├── PlaceModel.cs │ ├── PositionPointModel.cs │ ├── ProOrderModel.cs │ ├── PublishSubscribeAuthenticationDataTypes.cs │ ├── PublishSubscribeCreateModel.cs │ ├── PublishSubscribeEditModel.cs │ ├── PublishSubscribeModel.cs │ ├── RPMModel.cs │ ├── ResetPasswordUserModel.cs │ ├── ReverseGeocodingResult.cs │ ├── SignUpModel.cs │ ├── SlackPayloadModel.cs │ ├── TaskModel.cs │ ├── TemperatureModel.cs │ ├── TransportstyrelsenInfoModel.cs │ ├── TriggerCreateModel.cs │ ├── TriggerDetailModel.cs │ ├── TriggerEditModel.cs │ ├── TriggerEditMutedUntilModel.cs │ ├── TriggerMessageHistoryDetailModel.cs │ ├── TriggerModel.cs │ ├── TripAddNoteModel.cs │ ├── TripConcatenation.cs │ ├── TripDataAccelerometerEventModel.cs │ ├── TripDataAccelerometerModel.cs │ ├── TripDetailModel.cs │ ├── TripEditModel.cs │ ├── TripGeoModel.cs │ ├── TripModel.cs │ ├── TripStartEndGeoModel.cs │ ├── TripSummaryReportModel.cs │ ├── TripSynchronized.cs │ ├── UserCreateModel.cs │ ├── UserCreatedPasswordModel.cs │ ├── UserDeviceCreateModel.cs │ ├── UserDeviceEditModel.cs │ ├── UserDeviceModel.cs │ ├── UserExistingPasswordModel.cs │ ├── UserModel.cs │ ├── UserPhoneNumberModel.cs │ ├── UsernameTakenModel.cs │ ├── UsernamesPhoneNumberModel.cs │ ├── ValidatePinModel.cs │ ├── Vehicle2CreateModel.cs │ ├── Vehicle2DetailModel.cs │ ├── Vehicle2EditModel.cs │ ├── Vehicle2Model.cs │ ├── VehicleCheckInModel.cs │ ├── VehicleCreateModel.cs │ ├── VehicleDefectTypeModel.cs │ ├── VehicleDetailModel.cs │ ├── VehicleEditModel.cs │ ├── VehicleGeofenceCreateModel.cs │ ├── VehicleGeofenceEditModel.cs │ ├── VehicleGeofenceModel.cs │ ├── VehicleHealth.cs │ ├── VehicleInformationType.cs │ ├── VehicleInspectionCreateModels.cs │ ├── VehicleInspectionCreateModelwImage.cs │ ├── VehicleInspectionEditModel.cs │ ├── VehicleInspectionExportModel.cs │ ├── VehicleInspectionModels.cs │ ├── VehicleMakesModel.cs │ ├── VehicleMetadataModel.cs │ ├── VehicleModel.cs │ ├── VehicleSpeedModel.cs │ ├── VehicleStatusModel.cs │ ├── VehicleSummaryModel.cs │ ├── VehicleTinyModel.cs │ └── VehiclesSummaryModel.cs ├── Properties │ └── AssemblyInfo.cs ├── Types │ ├── ApiApplicationType.cs │ ├── ApiCategoryType.cs │ ├── ApiContentType.cs │ ├── ApiDeliveryType.cs │ ├── ApiDestinationType.cs │ ├── ApiDeviceType.cs │ ├── ApiGeofenceType.cs │ ├── ApiIMEIDeviceType.cs │ ├── ApiImageType.cs │ ├── ApiLeadActionType.cs │ ├── ApiMainFuelType.cs │ ├── ApiMapType.cs │ ├── ApiPrivacyPolicyType.cs │ ├── ApiPublishSubscribeAuthenticationType.cs │ ├── ApiPublishType.cs │ ├── ApiResetPasswordType.cs │ ├── ApiRoleTypeInCompany.cs │ ├── ApiTaskStatusType.cs │ ├── ApiTaskType.cs │ ├── ApiTransmissionType.cs │ ├── ApiTriggerType.cs │ ├── ApiTripType.cs │ ├── ApiUnitType.cs │ ├── ApiUserDeviceCertType.cs │ ├── ApiVehicleMetadataType.cs │ ├── ApiVehicleOwnerType.cs │ ├── AttachmentType.cs │ ├── FuelType.cs │ ├── GeofenceType.cs │ ├── OwnerType.cs │ ├── TransmissionType.cs │ ├── TripAccelerometerEventType.cs │ ├── TripDrivingEventType.cs │ ├── TripType.cs │ └── VehicleInspectionTypes.cs └── packages.config ├── README.md └── packages └── Newtonsoft.Json.9.0.1 ├── Newtonsoft.Json.9.0.1.nupkg ├── lib ├── net20 │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml ├── net35 │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml ├── net40 │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml ├── net45 │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml ├── netstandard1.0 │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml ├── portable-net40+sl5+wp80+win8+wpa81 │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml └── portable-net45+wp80+win8+wpa81 │ ├── Newtonsoft.Json.dll │ └── Newtonsoft.Json.xml └── tools └── install.ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | thumbs.db 3 | *.*scc 4 | *.FileListAbsolute.txt 5 | *.aps 6 | *.bak 7 | *.[Cc]ache 8 | *.clw 9 | *.eto 10 | *.exe 11 | *.fb6lck 12 | *.fbl6 13 | *.fbpInf 14 | *.ilk 15 | *.lib 16 | *.log 17 | *.ncb 18 | *.nlb 19 | *.dbmdl 20 | *.obj 21 | *.patch 22 | *.pch 23 | *.pdb 24 | *.plg 25 | *.[Pp]ublish.xml 26 | *.rdl.data 27 | *.sbr 28 | *.scc 29 | *.sig 30 | *.sqlsuo 31 | *.suo 32 | *.svclog 33 | *.tlb 34 | *.tlh 35 | *.tli 36 | *.tmp 37 | *.user 38 | *.vshost.* 39 | *_i.c 40 | *_p.c 41 | Ankh.Load 42 | Backup* 43 | CVS/ 44 | PrecompiledWeb/ 45 | UpgradeLog*.* 46 | obj/ 47 | [Bb]in/ 48 | [Dd]ebug/ 49 | [Oo]bj/ 50 | [Rr]elease/ 51 | [Tt]humbs.db 52 | _UpgradeReport_Files 53 | _[Rr]e[Ss]harper.*/ 54 | hgignore[.-]* 55 | ignore[.-]* 56 | svnignore[.-]* 57 | lint.db 58 | * - Copy 59 | re: - Copy \([0-9]+\) 60 | .hgignore.orig 61 | *.orig 62 | *.ncrunchproject 63 | *.*ncrunchsolution 64 | *desktop.ini 65 | .vs/ 66 | node_modules 67 | _node_modules 68 | node_generated 69 | bower_components 70 | .npm 71 | Temp/ 72 | nuget.config 73 | Solutions/ 74 | *.nupkg -------------------------------------------------------------------------------- /Automile.Net.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Automile.Net.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Automile.Net.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8d9a4f4b-ce1f-4f0e-a7a5-5957fb6c8210")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Automile.Net.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Automile.Net.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Automile.Net", "Automile.Net\Automile.Net.csproj", "{124B7E38-6425-48F3-8042-62AB15BA5F99}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Automile.Net.Tests", "Automile.Net.Tests\Automile.Net.Tests.csproj", "{8D9A4F4B-CE1F-4F0E-A7A5-5957FB6C8210}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{371DF0CB-7990-4A61-A1F1-965D63639F93}" 11 | ProjectSection(SolutionItems) = preProject 12 | README.md = README.md 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {124B7E38-6425-48F3-8042-62AB15BA5F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {124B7E38-6425-48F3-8042-62AB15BA5F99}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {124B7E38-6425-48F3-8042-62AB15BA5F99}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {124B7E38-6425-48F3-8042-62AB15BA5F99}.Release|Any CPU.Build.0 = Release|Any CPU 25 | {8D9A4F4B-CE1F-4F0E-A7A5-5957FB6C8210}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {8D9A4F4B-CE1F-4F0E-A7A5-5957FB6C8210}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {8D9A4F4B-CE1F-4F0E-A7A5-5957FB6C8210}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {8D9A4F4B-CE1F-4F0E-A7A5-5957FB6C8210}.Release|Any CPU.Build.0 = Release|Any CPU 29 | EndGlobalSection 30 | GlobalSection(SolutionProperties) = preSolution 31 | HideSolutionNode = FALSE 32 | EndGlobalSection 33 | EndGlobal 34 | -------------------------------------------------------------------------------- /Automile.Net/Automile.Net.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Automile.Net 5 | 0.3.0 6 | Automile.Net API for fleet management 7 | Automile Inc. 8 | Automile 9 | A library to help .NET developers easily access the Automile REST API 10 | Automile offers a simple, smart, cutting-edge telematics solution for businesses to track and manage their business vehicles. This library helps .NET developers to easily access the Automile REST API. Targets .NET 4.5. 11 | https://github.com/Automile/automile-net/blob/master/Automile.Net/LICENCE.txt 12 | https://github.com/Automile/automile-net 13 | 14 | http://content.automile.com/automile_logo_symbol_64x64.png 15 | 16 | false 17 | 18 | * 0.3.0 - Release supporting relationships to vehicles to fleets, drivers to fleets and support for publish-subscribe framework 19 | * 0.2.0 - Release supporting vehicles, trips, geofences, places, notifications, notification messages, fleets, devices, device events 20 | and relationships for geofences, places vehicles 21 | * 0.1.0 - Initial release supporting vehicles, trips, geofences, places, notifications and devices 22 | 23 | Copyright 2017 Automile Inc, 291 Alma Street, Palo Alto, California 943 01, United States 24 | tracking telematics gps fleet-management fleet iot automile vehicle 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Automile.Net/Client/Contacts.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public partial class AutomileClient 11 | { 12 | /// 13 | /// Get's all contacts (drivers) the user is authorized to 14 | /// 15 | /// 16 | public IEnumerable GetContacts() 17 | { 18 | var response = client.GetAsync("/v1/resourceowner/contacts2").Result; 19 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 20 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 21 | } 22 | 23 | /// 24 | /// Get the details about a specific contact (driver) 25 | /// 26 | /// 27 | /// 28 | public Contact2DetailModel GetContactById(int contactId) 29 | { 30 | var response = client.GetAsync($"/v1/resourceowner/contacts2/{contactId}").Result; 31 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 32 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 33 | } 34 | 35 | /// 36 | /// Get the details about you (driver) 37 | /// 38 | /// 39 | /// 40 | public Contact2DetailModel GetMe() 41 | { 42 | var response = client.GetAsync("/v1/resourceowner/contacts2/me").Result; 43 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 44 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 45 | } 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Automile.Net/Client/DeviceEvents.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get all device events (earlier called IMEIEvents) 15 | /// 16 | /// 17 | public IEnumerable GetDeviceEvents() 18 | { 19 | var response = client.GetAsync("/v1/resourceowner/imeievents").Result; 20 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 21 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 22 | } 23 | 24 | /// 25 | /// Get a specific MIL (Mileage Indicator Lamp) event 26 | /// 27 | /// 28 | /// 29 | public IMEIEventMILModel GetDeviceEventMILById(int deviceEventId) 30 | { 31 | var response = client.GetAsync($"/v1/resourceowner/imeievents/mil/{deviceEventId}").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 34 | } 35 | 36 | /// 37 | /// Get a specific DTC (Diagnostic Trouble Code) event 38 | /// 39 | /// 40 | /// 41 | public IMEIEventDTCModel GetDeviceEventDTCById(int deviceEventId) 42 | { 43 | var response = client.GetAsync($"/v1/resourceowner/imeievents/dtc/{deviceEventId}").Result; 44 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 45 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 46 | } 47 | 48 | /// 49 | /// Get a specific status event 50 | /// 51 | /// 52 | /// 53 | public IMEIEventStatusModel GetDeviceEventStatusById(int deviceEventId) 54 | { 55 | var response = client.GetAsync($"/v1/resourceowner/imeievents/status/{deviceEventId}").Result; 56 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 57 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Automile.Net/Client/Devices.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get all devices (earlier called IMEIConfigs) 15 | /// 16 | /// 17 | public IEnumerable GetDevices() 18 | { 19 | var response = client.GetAsync("/v1/resourceowner/imeiconfigs").Result; 20 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 21 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 22 | } 23 | 24 | /// 25 | /// Get details for the device 26 | /// 27 | /// 28 | /// 29 | public IMEIConfigDetailModel GetDeviceById(int deviceId) 30 | { 31 | var response = client.GetAsync($"/v1/resourceowner/imeiconfigs/{deviceId}").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 34 | } 35 | 36 | /// 37 | /// Registers a new device and associates it with a vehicle 38 | /// 39 | /// 40 | /// 41 | public IMEIConfigDetailModel CreateDevice(IMEIConfigCreateModel model) 42 | { 43 | string stringPayload = JsonConvert.SerializeObject(model); 44 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 45 | var response = client.PostAsync("/v1/resourceowner/imeiconfigs", content).Result; 46 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 47 | var urlToCreatedDevice = response.Headers.GetValues("Location").First(); 48 | var deviceModel = client.GetAsync(urlToCreatedDevice).Result; 49 | deviceModel.EnsureSuccessStatusCodeWithProperExceptionMessage(); 50 | return JsonConvert.DeserializeObject(deviceModel.Content.ReadAsStringAsync().Result); 51 | } 52 | 53 | /// 54 | /// Edit the device 55 | /// 56 | /// 57 | /// 58 | public void EditDevice(int deviceId, IMEIConfigEditModel model) 59 | { 60 | string stringPayload = JsonConvert.SerializeObject(model); 61 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 62 | var response = client.PutAsync($"/v1/resourceowner/imeiconfigs/{deviceId}", content).Result; 63 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 64 | } 65 | 66 | /// 67 | /// Deletes the device 68 | /// 69 | /// 70 | public void DeleteDevice(int deviceId) 71 | { 72 | var response = client.DeleteAsync($"/v1/resourceowner/imeiconfigs/{deviceId}").Result; 73 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 74 | } 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Automile.Net/Client/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public static class Extensions 11 | { 12 | public static void EnsureSuccessStatusCodeWithProperExceptionMessage(this HttpResponseMessage response) 13 | { 14 | if (!response.IsSuccessStatusCode) 15 | { 16 | var code = response.StatusCode; 17 | var phrase = response.ReasonPhrase; 18 | string msg = response.Content.ReadAsStringAsync().Result; 19 | throw new Exception($"Code: {code} Phrase: {phrase} Message: {msg}"); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Automile.Net/Client/FleetContacts.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get details about a specific relationship between the company and the contact 15 | /// 16 | /// 17 | /// The detailed model for the relationship 18 | public CompanyContactDetailModel GetFleetContactById(int fleetContactId) 19 | { 20 | var response = client.GetAsync($"/v1/resourceowner/companycontact/{fleetContactId}").Result; 21 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 22 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 23 | } 24 | 25 | /// 26 | /// Get all relationships between fleets and contacts 27 | /// 28 | /// The detailed model for the relationship 29 | public IEnumerable GetFleetContacts() 30 | { 31 | var response = client.GetAsync("/v1/resourceowner/companycontact").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 34 | } 35 | 36 | /// 37 | /// Get's all relationsships between a specific fleet and it's contacts 38 | /// 39 | /// 40 | /// 41 | public IEnumerable GetFleetContactsByFleetId(int fleetId) 42 | { 43 | var response = client.GetAsync($"/v1/resourceowner/companycontact?companyId={fleetId}").Result; 44 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 45 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 46 | } 47 | 48 | /// 49 | /// Creates a relationship between a fleet and a contact and returns the newly created relationship 50 | /// 51 | /// 52 | /// 53 | public CompanyContactDetailModel CreateFleetContact(CompanyContactCreateModel model) 54 | { 55 | string stringPayload = JsonConvert.SerializeObject(model); 56 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 57 | var response = client.PostAsync($"/v1/resourceowner/companycontact", content).Result; 58 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 59 | var urlToCreatedFleetContact = response.Headers.GetValues("Location").First(); 60 | var fleetContactModel = client.GetAsync(urlToCreatedFleetContact).Result; 61 | fleetContactModel.EnsureSuccessStatusCodeWithProperExceptionMessage(); 62 | return JsonConvert.DeserializeObject(fleetContactModel.Content.ReadAsStringAsync().Result); 63 | } 64 | 65 | /// 66 | /// Edit a relationship between a fleet and a contact 67 | /// 68 | /// 69 | /// 70 | public void EditFleetContact(int fleetContactId, CompanyContactEditModel model) 71 | { 72 | string stringPayload = JsonConvert.SerializeObject(model); 73 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 74 | var response = client.PutAsync($"/v1/resourceowner/companycontact/{fleetContactId}", content).Result; 75 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 76 | } 77 | 78 | /// 79 | /// Delete a relationship between a fleet and a contact 80 | /// 81 | /// 82 | public void DeleteFleetContact(int fleetContactId) 83 | { 84 | var response = client.DeleteAsync($"/v1/resourceowner/companycontact/{fleetContactId}").Result; 85 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Automile.Net/Client/FleetVehicles.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get details about a specific relationship between the company and the vehicle 15 | /// 16 | /// 17 | /// The detailed model for the relationship 18 | public CompanyVehicleModel GetFleetVehicleById(int fleetVehicleId) 19 | { 20 | var response = client.GetAsync($"/v1/resourceowner/companyvehicle/{fleetVehicleId}").Result; 21 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 22 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 23 | } 24 | 25 | /// 26 | /// Get all relationships between fleets and vehicles 27 | /// 28 | /// The detailed model for the relationship 29 | public IEnumerable GetFleetVehicles() 30 | { 31 | var response = client.GetAsync("/v1/resourceowner/companyvehicle").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 34 | } 35 | 36 | /// 37 | /// Get's all relationsships between a specific fleet and it's vehicles 38 | /// 39 | /// 40 | /// 41 | public IEnumerable GetFleetVehiclesByFleetId(int fleetId) 42 | { 43 | var response = client.GetAsync($"/v1/resourceowner/companyvehicle?companyId={fleetId}").Result; 44 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 45 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 46 | } 47 | 48 | /// 49 | /// Creates a relationship between a fleet and a vehicle and returns the newly created relationship 50 | /// 51 | /// 52 | /// 53 | public CompanyVehicleModel CreateFleetVehicle(CompanyVehicleCreateModel model) 54 | { 55 | string stringPayload = JsonConvert.SerializeObject(model); 56 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 57 | var response = client.PostAsync($"/v1/resourceowner/companyvehicle", content).Result; 58 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 59 | var urlToCreatedFleetVehicle = response.Headers.GetValues("Location").First(); 60 | var fleetVehicleModel = client.GetAsync(urlToCreatedFleetVehicle).Result; 61 | fleetVehicleModel.EnsureSuccessStatusCodeWithProperExceptionMessage(); 62 | return JsonConvert.DeserializeObject(fleetVehicleModel.Content.ReadAsStringAsync().Result); 63 | } 64 | 65 | /// 66 | /// Edit a relationship between a fleet and a vehicle 67 | /// 68 | /// 69 | /// 70 | public void EditFleetVehicle(int fleetVehicleId, CompanyVehicleEditModel model) 71 | { 72 | string stringPayload = JsonConvert.SerializeObject(model); 73 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 74 | var response = client.PutAsync($"/v1/resourceowner/companyvehicle/{fleetVehicleId}", content).Result; 75 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 76 | } 77 | 78 | /// 79 | /// Delete a relationship between a fleet and a vehicle 80 | /// 81 | /// 82 | public void DeleteFleetVehicle(int fleetVehicleId) 83 | { 84 | var response = client.DeleteAsync($"/v1/resourceowner/companyvehicle/{fleetVehicleId}").Result; 85 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Automile.Net/Client/Fleets.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get's all fleets the user is authorized to 15 | /// 16 | /// 17 | public IEnumerable GetFleets() 18 | { 19 | var response = client.GetAsync("/v1/resourceowner/companies").Result; 20 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 21 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 22 | } 23 | 24 | /// 25 | /// Get details about a specific fleet 26 | /// 27 | /// 28 | /// The detailed model for the fleet 29 | public CompanyDetailModel GetFleetById(int fleetId) 30 | { 31 | var response = client.GetAsync($"/v1/resourceowner/companies/{fleetId}").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 34 | } 35 | 36 | /// 37 | /// Creates a new fleet and returns the model for the newly created fleet 38 | /// 39 | /// 40 | /// 41 | public CompanyDetailModel CreateFleet(CompanyCreateModel model) 42 | { 43 | string stringPayload = JsonConvert.SerializeObject(model); 44 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 45 | var response = client.PostAsync($"/v1/resourceowner/companies", content).Result; 46 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 47 | var urlToCreatedFleet = response.Headers.GetValues("Location").First(); 48 | var fleetModelResponse = client.GetAsync(urlToCreatedFleet).Result; 49 | fleetModelResponse.EnsureSuccessStatusCodeWithProperExceptionMessage(); 50 | return JsonConvert.DeserializeObject(fleetModelResponse.Content.ReadAsStringAsync().Result); 51 | } 52 | 53 | /// 54 | /// Edit a fleet 55 | /// 56 | /// 57 | /// 58 | public void EditFleet(int fleetId, CompanyEditModel model) 59 | { 60 | string stringPayload = JsonConvert.SerializeObject(model); 61 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 62 | var response = client.PutAsync($"/v1/resourceowner/companies/{fleetId}", content).Result; 63 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 64 | } 65 | 66 | 67 | /// 68 | /// Delete a fleet 69 | /// 70 | /// 71 | public void DeleteFleet(int fleetId) 72 | { 73 | var response = client.DeleteAsync($"/v1/resourceowner/companies/{fleetId}").Result; 74 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 75 | } 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /Automile.Net/Client/Geofence.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get all geofences belonging to all vehicles 15 | /// 16 | /// 17 | public IEnumerable GetGeofences() 18 | { 19 | var response = client.GetAsync("/v1/resourceowner/geofence").Result; 20 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 21 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 22 | } 23 | 24 | /// 25 | /// Get the details about a specific geofence 26 | /// 27 | /// 28 | /// 29 | public GeofenceModel GetGeofenceById(int geofenceId) 30 | { 31 | var response = client.GetAsync($"/v1/resourceowner/geofence/{geofenceId}").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 34 | } 35 | 36 | /// 37 | /// Creates a new vehicle and returns the model for the newly created vehicle 38 | /// 39 | /// 40 | /// 41 | public GeofenceModel CreateGeofence(GeofenceCreateModel model) 42 | { 43 | string stringPayload = JsonConvert.SerializeObject(model); 44 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 45 | var response = client.PostAsync("/v1/resourceowner/geofence", content).Result; 46 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 47 | var urlToCreatedGeofence = response.Headers.GetValues("Location").First(); 48 | var geofenceModelResponse = client.GetAsync(urlToCreatedGeofence).Result; 49 | geofenceModelResponse.EnsureSuccessStatusCodeWithProperExceptionMessage(); 50 | return JsonConvert.DeserializeObject(geofenceModelResponse.Content.ReadAsStringAsync().Result); 51 | } 52 | 53 | /// 54 | /// Edit geofence 55 | /// 56 | /// 57 | /// 58 | public void EditGeofence(int geofenceId, GeofenceEditModel model) 59 | { 60 | string stringPayload = JsonConvert.SerializeObject(model); 61 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 62 | var response = client.PutAsync($"/v1/resourceowner/geofence/{geofenceId}", content).Result; 63 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 64 | } 65 | 66 | /// 67 | /// Deletes the geofence 68 | /// 69 | /// 70 | public void DeleteGeofence(int geofenceId) 71 | { 72 | var response = client.DeleteAsync($"/v1/resourceowner/geofence/{geofenceId}").Result; 73 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 74 | } 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Automile.Net/Client/NotificationMessages.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get's all notification messages sent in the past 15 | /// 16 | /// 17 | public IEnumerable GetNotificationMessages() 18 | { 19 | var response = client.GetAsync("/v1/resourceowner/triggermessageshistory").Result; 20 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 21 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 22 | } 23 | 24 | /// 25 | /// Get notification messages sent in the past for a specific notification 26 | /// 27 | /// 28 | /// 29 | public IEnumerable GetNotificationMessagesByNotificationId(int notificationId) 30 | { 31 | var response = client.GetAsync($"/v1/resourceowner/triggermessageshistory/{notificationId}").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Automile.Net/Client/OwnerReport.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Net.Http; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Automile.Net 11 | { 12 | public partial class AutomileClient 13 | { 14 | /// 15 | /// The trip summary report are returned 16 | /// 17 | /// /// 18 | /// 19 | public IEnumerable GetTripSummaryReport(string dateperiod) 20 | { 21 | var response = client.GetAsync($"/v1/resourceowner/reports/tripsummary/{dateperiod}").Result; 22 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 23 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 24 | } 25 | 26 | /// 27 | /// Get a trip summary report filtered by vehicle 28 | /// 29 | /// /// 30 | /// /// 31 | /// 32 | public IEnumerable GetTripSummaryReportByVehicleId(string dateperiod, int vehicleId) 33 | { 34 | var response = client.GetAsync($"/v1/resourceowner/reports/tripsummary/{dateperiod}/{vehicleId}").Result; 35 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 36 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 37 | } 38 | 39 | /// 40 | /// Get vehicles summary report 41 | /// 42 | /// /// 43 | /// The vehicles summary report is returned 44 | public VehiclesSummaryModel GetVehiclesSummaryReport(string dateperiod) 45 | { 46 | var response = client.GetAsync($"/v1/resourceowner/reports/vehiclessummary/{dateperiod}").Result; 47 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 48 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 49 | } 50 | 51 | /// 52 | /// Get a vehicle summary report 53 | /// 54 | /// /// 55 | /// /// 56 | /// 57 | public VehicleSummaryModel GetVehicleSummaryReportByVehicleId(string dateperiod, int vehicleId) 58 | { 59 | var response = client.GetAsync($"/v1/resourceowner/reports/vehiclesummary/{dateperiod}/{vehicleId}").Result; 60 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 61 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 62 | } 63 | 64 | /// 65 | /// Email a trip journal report to a desired email address 66 | /// 67 | /// /// 68 | /// A summary of all trips made in the period emailed to desired email address 69 | public HttpStatusCode EmailTripReport(EmailTripReportModel model) 70 | { 71 | string stringPayload = JsonConvert.SerializeObject(model); 72 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 73 | var response = client.PostAsync("/v1/resourceowner/reports/emailtripreport", content).Result; 74 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 75 | return response.StatusCode; 76 | } 77 | 78 | /// 79 | /// Get Log of GeoFences the user is authorized to 80 | /// 81 | /// // /// 82 | /// 83 | public GeofenceReportModel GetGeofenceLog(int? vehicleId = null, 84 | int? geofenceId = null, 85 | DateTime? fromDate = null, 86 | DateTime? toDate = null) 87 | { 88 | var response = client.GetAsync($"/v1/resourceowner/reports/geofencelog?vehicleId={vehicleId}&geofenceId={geofenceId}&fromDate={fromDate}&toDate={toDate}").Result; 89 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 90 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Automile.Net/Client/Places.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get all places belonging to all vehicles 15 | /// 16 | /// 17 | public IEnumerable GetPlaces() 18 | { 19 | var response = client.GetAsync("/v1/resourceowner/place").Result; 20 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 21 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 22 | } 23 | 24 | /// 25 | /// Get the details about a specific place 26 | /// 27 | /// 28 | /// 29 | public PlaceModel GetPlaceById(int placeId) 30 | { 31 | var response = client.GetAsync($"/v1/resourceowner/place/{placeId}").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 34 | } 35 | 36 | /// 37 | /// Creates a place and associates it with the first vehicle and returns the created place 38 | /// 39 | /// 40 | /// 41 | public PlaceModel CreatePlace(PlaceCreateModel model) 42 | { 43 | if (model.TripTypeTrigger.HasValue == true && model.TripTypeTrigger.Value == ApiTripTypeTrigger.DrivesBetween && model.DrivesBetweenAnotherPlaceId.HasValue == false) 44 | throw new ArgumentException("You need to enter the second place when you select the drives between type, use the DrivesBetweenAnotherPlaceId property"); 45 | 46 | if ((model.TripTypeTrigger.HasValue == false || (model.TripTypeTrigger.HasValue == true && model.TripTypeTrigger.Value != ApiTripTypeTrigger.DrivesBetween)) && model.DrivesBetweenAnotherPlaceId.HasValue == true) 47 | throw new ArgumentException("You can't use DrivesBetweenAnotherPlaceId property if the TripTypeTrigger is null or isnt't equal to DrivesBetween type"); 48 | 49 | string stringPayload = JsonConvert.SerializeObject(model); 50 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 51 | var response = client.PostAsync("/v1/resourceowner/place", content).Result; 52 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 53 | var urlToCreatedPlace = response.Headers.GetValues("Location").First(); 54 | var placeModelResult = client.GetAsync(urlToCreatedPlace).Result; 55 | placeModelResult.EnsureSuccessStatusCodeWithProperExceptionMessage(); 56 | return JsonConvert.DeserializeObject(placeModelResult.Content.ReadAsStringAsync().Result); 57 | } 58 | 59 | /// 60 | /// Edit place 61 | /// 62 | /// 63 | /// 64 | public void EditPlace(int placeId, PlaceEditModel model) 65 | { 66 | if (model.TripTypeTrigger.HasValue == true && model.TripTypeTrigger.Value == ApiTripTypeTrigger.DrivesBetween && model.DrivesBetweenAnotherPlaceId.HasValue == false) 67 | throw new ArgumentException("You need to enter the second place when you select the drives between type, use the DrivesBetweenAnotherPlaceId property"); 68 | 69 | if ((model.TripTypeTrigger.HasValue == false || (model.TripTypeTrigger.HasValue == true && model.TripTypeTrigger.Value != ApiTripTypeTrigger.DrivesBetween)) && model.DrivesBetweenAnotherPlaceId.HasValue == true) 70 | throw new ArgumentException("You can't use DrivesBetweenAnotherPlaceId property if the TripTypeTrigger is null or isnt't equal to DrivesBetween type"); 71 | 72 | string stringPayload = JsonConvert.SerializeObject(model); 73 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 74 | var response = client.PutAsync($"/v1/resourceowner/place/{placeId}", content).Result; 75 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 76 | } 77 | 78 | /// 79 | /// Deletes the geofence 80 | /// 81 | /// 82 | public void DeletePlace(int placeId) 83 | { 84 | var response = client.DeleteAsync($"/v1/resourceowner/place/{placeId}").Result; 85 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 86 | } 87 | 88 | 89 | 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Automile.Net/Client/TaskMessage.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// The task message details are returned 15 | /// 16 | /// /// 17 | /// 18 | public TaskMessageModel GetByTaskMessageId(int taskMessageId) 19 | { 20 | var response = client.GetAsync($"/v1/resourceowner/taskmessage/{taskMessageId}").Result; 21 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 22 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 23 | } 24 | 25 | /// 26 | /// Create a task Message 27 | /// 28 | /// 29 | /// 30 | public TaskMessageCreateModel CreateTaskMessage(TaskMessageCreateModel model) 31 | { 32 | 33 | string stringPayload = JsonConvert.SerializeObject(model); 34 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 35 | var response = client.PostAsync("/v1/resourceowner/taskmessage", content).Result; 36 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 37 | var urlToCreatedTaskMessage = response.Headers.GetValues("Location").First(); 38 | var taskmessageModelResult = client.GetAsync(urlToCreatedTaskMessage).Result; 39 | taskmessageModelResult.EnsureSuccessStatusCodeWithProperExceptionMessage(); 40 | return JsonConvert.DeserializeObject(taskmessageModelResult.Content.ReadAsStringAsync().Result); 41 | } 42 | /// 43 | /// Edit the Task Message 44 | /// 45 | /// 46 | /// 47 | public void EditTaskMessage(int taskMessageId,TaskMessageEditModel model) 48 | { 49 | string stringPayload = JsonConvert.SerializeObject(model); 50 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 51 | var response = client.PutAsync($"/v1/resourceowner/taskmessage/{taskMessageId}", content).Result; 52 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 53 | } 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Automile.Net/Client/Tasks.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get all tasks open and closed 15 | /// 16 | /// 17 | public IEnumerable GetTasks() 18 | { 19 | var response = client.GetAsync("/v1/resourceowner/task").Result; 20 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 21 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 22 | } 23 | 24 | /// 25 | /// Get the details about a specific task 26 | /// 27 | /// 28 | /// 29 | public TaskDetailModel GetByTaskId(int taskId) 30 | { 31 | var response = client.GetAsync($"/v1/resourceowner/task/{taskId}").Result; 32 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 33 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 34 | } 35 | 36 | /// 37 | /// Create a task 38 | /// 39 | /// 40 | /// 41 | public TaskDetailModel CreateTask(TaskCreateModel model) 42 | { 43 | if (model.ToContactId.HasValue == false) 44 | throw new ArgumentException("You need to enter to which contact / driver the message should be sent to"); 45 | 46 | string stringPayload = JsonConvert.SerializeObject(model); 47 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 48 | var response = client.PostAsync("/v1/resourceowner/task", content).Result; 49 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 50 | var urlToCreatedTask = response.Headers.GetValues("Location").First(); 51 | var taskModelResult = client.GetAsync(urlToCreatedTask).Result; 52 | taskModelResult.EnsureSuccessStatusCodeWithProperExceptionMessage(); 53 | return JsonConvert.DeserializeObject(taskModelResult.Content.ReadAsStringAsync().Result); 54 | } 55 | 56 | /// 57 | /// Edit task message 58 | /// 59 | /// 60 | /// 61 | public void EditTask(int taskId, TaskMessageEditModel model) 62 | { 63 | string stringPayload = JsonConvert.SerializeObject(model); 64 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 65 | var response = client.PutAsync($"/v1/resourceowner/task/{taskId}", content).Result; 66 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 67 | } 68 | 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Automile.Net/Client/TokenPair.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class TokenPair 11 | { 12 | [JsonProperty("access_token")] 13 | public string AccessToken { get; set; } 14 | 15 | [JsonProperty("token_type")] 16 | public string TokenType { get; set; } 17 | 18 | [JsonProperty("expires_in")] 19 | public int ExpiresIn { get; set; } 20 | 21 | [JsonProperty("refresh_token")] 22 | public string RefreshToken { get; set; } 23 | 24 | public DateTime Expires { get; set; } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Automile.Net/Client/VehicleGeofences.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get details about a specific relationship between the geofence and the vehicle 15 | /// 16 | /// 17 | /// The detailed model for the relationship 18 | public VehicleGeofenceModel GetVehicleGeofenceById(int vehicleGeofenceId) 19 | { 20 | var response = client.GetAsync($"/v1/resourceowner/vehiclegeofence/{vehicleGeofenceId}").Result; 21 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 22 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 23 | } 24 | 25 | /// 26 | /// Get's all relationsships betwen geofences and vehicles 27 | /// 28 | /// 29 | /// 30 | public IEnumerable GetVehicleGeofencesByGeofenceId(int geofenceId) 31 | { 32 | var response = client.GetAsync($"/v1/resourceowner/vehiclegeofence?geofenceId={geofenceId}").Result; 33 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 34 | return JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().Result); 35 | } 36 | 37 | /// 38 | /// Creates a relationship between a vehicle and a geofence and returns the newly created relationship 39 | /// 40 | /// 41 | /// 42 | public VehicleGeofenceModel CreateVehicleGeofence(VehicleGeofenceCreateModel model) 43 | { 44 | string stringPayload = JsonConvert.SerializeObject(model); 45 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 46 | var response = client.PostAsync($"/v1/resourceowner/vehiclegeofence", content).Result; 47 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 48 | var urlToCreatedVehicleGeofence = response.Headers.GetValues("Location").First(); 49 | var vehicleGeofenceModelResponse = client.GetAsync(urlToCreatedVehicleGeofence).Result; 50 | vehicleGeofenceModelResponse.EnsureSuccessStatusCodeWithProperExceptionMessage(); 51 | return JsonConvert.DeserializeObject(vehicleGeofenceModelResponse.Content.ReadAsStringAsync().Result); 52 | } 53 | 54 | 55 | /// 56 | /// Edit a relationship between a vehicle and a geofence 57 | /// 58 | /// 59 | /// 60 | public void EditVehicleGeofence(int vehicleGeofenceId, VehicleGeofenceEditModel model) 61 | { 62 | string stringPayload = JsonConvert.SerializeObject(model); 63 | var content = new StringContent(stringPayload, Encoding.UTF8, "application/json"); 64 | var response = client.PutAsync($"/v1/resourceowner/vehiclegeofence/{vehicleGeofenceId}", content).Result; 65 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 66 | } 67 | 68 | /// 69 | /// Delete a relationship between a vehicle and a geofence 70 | /// 71 | /// 72 | public void DeleteVehicleGeofence(int vehicleGeofenceId) 73 | { 74 | var response = client.DeleteAsync($"/v1/resourceowner/vehiclegeofence/{vehicleGeofenceId}").Result; 75 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Automile.Net/Client/VehicleHealth.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Automile.Net 10 | { 11 | public partial class AutomileClient 12 | { 13 | /// 14 | /// Get a number of health indicators about a specific vehicle 15 | /// 16 | /// 17 | /// The detailed model for the vehicle 18 | public VehicleHealth GetVehicleHealthByVehicleId(int vehicleId) 19 | { 20 | var response = client.GetAsync($"/v1/resourceowner/vehiclehealth/{vehicleId}").Result; 21 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 22 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 23 | } 24 | 25 | /// 26 | /// Get a number of health indicators about a specific vehicle over a specific period 27 | /// 28 | /// 29 | /// 30 | /// The detailed model for the vehicle 31 | public VehicleHealth GetVehicleHealthByVehicleId(string dateperiod, int vehicleId) 32 | { 33 | var response = client.GetAsync($"/v1/resourceowner/vehiclehealth/{vehicleId}").Result; 34 | response.EnsureSuccessStatusCodeWithProperExceptionMessage(); 35 | return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Automile.Net/Models/APIAuthorizationModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class APIAuthorizationModel 10 | { 11 | public int APIAuthorizationId { get; set;} 12 | public DateTime IssueDate { get; set;} 13 | public int APIClientId { get; set;} 14 | public int UserId { get; set;} 15 | public string ScopesDelimitedBySpaces { get; set;} 16 | public DateTime? ExpirationDateUtc { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Automile.Net/Models/APIClientModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class APIClientModel 10 | { 11 | public int APIClientId { get; set; } 12 | public string APIClientIdentifier { get; set; } 13 | public string Name { get; set; } 14 | public string ScopesDelimitedBySpaces { get; set; } 15 | public string ClientType { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Models/AmbientAirTemperatureModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | /// 10 | /// PID70 11 | /// 12 | public class AmbientAirTemperatureModel 13 | { 14 | public double TemperatureInCelsius { get; set; } 15 | 16 | public DateTime RecordTimeStamp { get; set; } 17 | 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Automile.Net/Models/ApiPublishSubscribeAuthenticationType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.API.Types 2 | { 3 | public enum ApiPublishSubscribeAuthenticationType : byte 4 | { 5 | NoneAnonymous = 0, 6 | BasicUsernameAndPassword = 1, 7 | BearerToken = 2, 8 | Salesforce = 3 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Automile.Net/Models/ApiPublishType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.API.Types 2 | { 3 | public enum ApiPublishType : byte 4 | { 5 | JsonDefault = 0 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Automile.Net/Models/ByteArrayConverter .cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace Automile.Net 9 | { 10 | public class ByteArrayConverter : JsonConverter 11 | { 12 | public override void WriteJson( 13 | JsonWriter writer, 14 | object value, 15 | JsonSerializer serializer) 16 | { 17 | if (value == null) 18 | { 19 | writer.WriteNull(); 20 | return; 21 | } 22 | 23 | byte[] data = (byte[])value; 24 | 25 | // Compose an array. 26 | writer.WriteStartArray(); 27 | 28 | for (var i = 0; i < data.Length; i++) 29 | { 30 | writer.WriteValue(data[i]); 31 | if (i != data.Length-1) 32 | { 33 | writer.WriteRaw(","); 34 | } 35 | } 36 | 37 | writer.WriteEndArray(); 38 | } 39 | 40 | public override object ReadJson( 41 | JsonReader reader, 42 | Type objectType, 43 | object existingValue, 44 | JsonSerializer serializer) 45 | { 46 | if (reader.TokenType == JsonToken.StartArray) 47 | { 48 | var byteList = new List(); 49 | 50 | while (reader.Read()) 51 | { 52 | switch (reader.TokenType) 53 | { 54 | case JsonToken.Integer: 55 | byteList.Add(Convert.ToByte(reader.Value)); 56 | break; 57 | case JsonToken.EndArray: 58 | return byteList.ToArray(); 59 | case JsonToken.Comment: 60 | // skip 61 | break; 62 | default: 63 | throw new Exception( 64 | string.Format( 65 | "Unexpected token when reading bytes: {0}", 66 | reader.TokenType)); 67 | } 68 | } 69 | 70 | throw new Exception("Unexpected end when reading bytes."); 71 | } 72 | else 73 | { 74 | throw new Exception( 75 | string.Format( 76 | "Unexpected token parsing binary. " 77 | + "Expected StartArray, got {0}.", 78 | reader.TokenType)); 79 | } 80 | } 81 | 82 | public override bool CanConvert(Type objectType) 83 | { 84 | return objectType == typeof(byte[]); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Automile.Net/Models/ChangeUserNameModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class ChangeUserNameModel 10 | { 11 | public string NewUserName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyContactCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class CompanyContactCreateModel 11 | { 12 | [Required] 13 | public int CompanyId { get; set; } 14 | 15 | [Required] 16 | public int ContactId { get; set; } 17 | 18 | 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyContactDetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class CompanyContactDetailModel 10 | { 11 | public int CompanyContactId { get; set; } 12 | public int CompanyId { get; set; } 13 | public string CompanyName { get; set; } 14 | public int ContactId { get; set; } 15 | public string ContactName { get; set; } 16 | public string[] Scopes { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyContactEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class CompanyContactEditModel 11 | { 12 | //[Required] 13 | //public int CompanyContactId { get; set; } 14 | 15 | [Required] 16 | public int CompanyId { get; set; } 17 | 18 | [Required] 19 | public int ContactId { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Automile.Net 9 | { 10 | public class CompanyCreateModel 11 | { 12 | [Required] 13 | [StringLength(255)] 14 | public string RegisteredCompanyName { get; set; } 15 | public string RegistrationNumber { get; set; } 16 | public string Description { get; set; } 17 | 18 | [Required] 19 | public int? CreateRelationshipToContactId { get; set; } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyDetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Automile.Net 9 | { 10 | public class CompanyDetailModel 11 | { 12 | public int CompanyId { get; set; } 13 | public string RegisteredCompanyName { get; set; } 14 | public string RegistrationNumber { get; set; } 15 | public string Description { get; set; } 16 | public DateTime? LastModified { get; set; } 17 | public DateTime Created { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Automile.Net 9 | { 10 | public class CompanyEditModel 11 | { 12 | [Required] 13 | [StringLength(255)] 14 | public string RegisteredCompanyName { get; set; } 15 | public string RegistrationNumber { get; set; } 16 | public string Description { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyInfoModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class CompanyInfoModel 4 | { 5 | public string CompanyName { get; set; } 6 | public string MobilePhoneNumber { get; set; } 7 | public string AddressLine1 { get; set; } 8 | public string City { get; set; } 9 | public string PostalNumber { get; set; } 10 | public string Country { get; set; } 11 | public int? NumberOfVehicles { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Automile.Net 9 | { 10 | public class CompanyModel 11 | { 12 | public int CompanyId { get; set; } 13 | public string RegisteredCompanyName { get; set; } 14 | public string RegistrationNumber { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyScopesModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Automile.Net 4 | { 5 | public class CompanyScopesModel 6 | { 7 | public int CompanyId { get; set; } 8 | public List VehicleIds { get; set; } 9 | public string[] Scopes { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyVehicleCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class CompanyVehicleCreateModel 11 | { 12 | [Required] 13 | public int CompanyId { get; set; } 14 | [Required] 15 | public int VehicleId { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyVehicleEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class CompanyVehicleEditModel 11 | { 12 | [Required] 13 | public int CompanyId { get; set; } 14 | [Required] 15 | public int VehicleId { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Models/CompanyVehicleModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class CompanyVehicleModel 10 | { 11 | public int CompanyVehicleId { get; set; } 12 | public int CompanyId { get; set; } 13 | public int VehicleId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Automile.Net/Models/Contact2CreateModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | 4 | namespace Automile.Net 5 | { 6 | public class Contact2CreateModel 7 | { 8 | [Required] 9 | public string FirstName { get; set; } 10 | [Required] 11 | public string LastName { get; set; } 12 | public string EmailAddress { get; set; } 13 | public string Description { get; set; } 14 | [Required] 15 | public int? CreateRelationshipToCompanyId { get; set; } 16 | public string CultureName { get; set; } 17 | public string CountryCodeIso1366 { get; set; } 18 | public int? DefaultVehicleId { get; set; } 19 | public ApiUnitType UnitType { get; set; } 20 | public bool SubscribeToNewsLetter { get; set; } 21 | public string MobilePhoneNumber { get; set; } 22 | public ApiMapType? MapType { get; set; } 23 | 24 | /// 25 | /// ISO 4217 Currency code 26 | /// 27 | public string CurrencyCode { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Automile.Net/Models/Contact2DetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | 9 | namespace Automile.Net 10 | { 11 | public class Contact2DetailModel 12 | { 13 | public int ContactId { get; set; } 14 | public string FirstName { get; set; } 15 | public string LastName { get; set; } 16 | public string EmailAddress { get; set; } 17 | public string Description { get; set; } 18 | public string CultureName { get; set; } 19 | public string CountryCodeIso1366 { get; set; } 20 | public int? DefaultVehicleId { get; set; } 21 | public ApiUnitType UnitType { get; set; } 22 | public bool SubscribeToNewsLetter { get; set; } 23 | public string MobilePhoneNumber { get; set; } 24 | 25 | public ApiMapType? MapType { get; set; } 26 | public int? CheckedIntoVehicleId { get; set; } 27 | public DateTime? CheckedInDateTimeUtc { get; set; } 28 | public DateTime? CheckOutDateTimeUtc { get; set; } 29 | 30 | public ApiTripType? CheckedInTripType { get; set; } 31 | 32 | public List CompanyRoles { get; set; } 33 | public string ProfileImageUrl { get; set; } 34 | 35 | /// 36 | /// ISO 4217 Currency code 37 | /// 38 | public string CurrencyCode { get; set; } 39 | 40 | public List CompaniesScopes { get; set; } 41 | public bool IsLocked { get; set; } 42 | 43 | public List CustomCategories { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Automile.Net/Models/Contact2EditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | 9 | 10 | namespace Automile.Net 11 | { 12 | public class Contact2EditModel 13 | { 14 | public string FirstName { get; set; } 15 | public string LastName { get; set; } 16 | public string EmailAddress { get; set; } 17 | public string Description { get; set; } 18 | public string CultureName { get; set; } 19 | public string CountryCodeIso1366 { get; set; } 20 | public int? DefaultVehicleId { get; set; } 21 | public ApiUnitType UnitType { get; set; } 22 | public bool SubscribeToNewsLetter { get; set; } 23 | public string MobilePhoneNumber { get; set; } 24 | public ApiMapType? MapType { get; set; } 25 | 26 | public DateTime? CheckOutDateTimeUtc { get; set; } 27 | public ApiTripType? CheckedInTripType { get; set; } 28 | 29 | /// 30 | /// ISO 4217 Currency code 31 | /// 32 | public string CurrencyCode { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Automile.Net/Models/Contact2Model.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | 9 | 10 | namespace Automile.Net 11 | { 12 | public class Contact2Model 13 | { 14 | public int ContactId { get; set; } 15 | public string FirstName { get; set; } 16 | public string LastName { get; set; } 17 | public string EmailAddress { get; set; } 18 | public string MobilePhoneNumber { get; set; } 19 | public string ProfileImageUrl { get; set; } 20 | public DateTime? CheckedInDateTimeUtc { get; set; } 21 | public int? CheckedIntoVehicleId { get; set; } 22 | public bool IsManager { get; set; } 23 | 24 | public List CompanyRoles { get; set; } 25 | 26 | /// 27 | /// ISO 4217 Currency code 28 | /// 29 | public string CurrencyCode { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Automile.Net/Models/ContactCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | 4 | namespace Automile.Net 5 | { 6 | public class ContactCreateModel 7 | { 8 | [Required] 9 | public string FirstName { get; set; } 10 | [Required] 11 | public string LastName { get; set; } 12 | public string EmailAddress { get; set; } 13 | public string Description { get; set; } 14 | [Required] 15 | public int? CreateRelationshipToCompanyId { get; set; } 16 | public string CultureName { get; set; } 17 | // public string CountryCodeIso1366 { get; set; } 18 | public int? DefaultVehicleId { get; set; } 19 | // public ApiUnitType UnitType { get; set; } 20 | // public bool SubscribeToNewsLetter { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Automile.Net/Models/ContactDetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | 9 | namespace Automile.Net 10 | { 11 | public class ContactDetailModel 12 | { 13 | public int ContactId { get; set; } 14 | public string FirstName { get; set; } 15 | public string LastName { get; set; } 16 | public string EmailAddress { get; set; } 17 | public string Description { get; set; } 18 | public string CultureName { get; set; } 19 | // public string CountryCodeIso1366 { get; set; } 20 | public int? DefaultVehicleId { get; set; } 21 | // public ApiUnitType UnitType { get; set; } 22 | // public bool SubscribeToNewsLetter { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Automile.Net/Models/ContactEditModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Text; 4 | using System.Threading.Tasks; 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | 8 | 9 | namespace Automile.Net 10 | { 11 | public class ContactEditModel 12 | { 13 | [Required] 14 | public string FirstName { get; set; } 15 | [Required] 16 | public string LastName { get; set; } 17 | public string EmailAddress { get; set; } 18 | public string Description { get; set; } 19 | public string CultureName { get; set; } 20 | //public string CountryCodeIso1366 { get; set; } 21 | public int? DefaultVehicleId { get; set; } 22 | // public ApiUnitType UnitType { get; set; } 23 | // public bool SubscribeToNewsLetter { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Automile.Net/Models/ContactMeModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class ContactMeModel 4 | { 5 | public string Name { get; set; } 6 | public string Email { get; set; } 7 | public string Phone { get; set; } 8 | public string Company { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ContactModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Text; 4 | using System.Threading.Tasks; 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class ContactModel 11 | { 12 | public int ContactId { get; set; } 13 | public string FirstName { get; set; } 14 | public string LastName { get; set; } 15 | public string EmailAddress { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Models/ContactVehicleCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class ContactVehicleCreateModel 11 | { 12 | 13 | [Required] 14 | public int VehicleId { get; set; } 15 | 16 | [Required] 17 | public int ContactId { get; set; } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Automile.Net/Models/ContactVehicleDetailModel.cs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class ContactVehicleDetailModel 10 | { 11 | public int ContactVehicleId { get; set; } 12 | public int VehicleId { get; set; } 13 | public string NumberPlate { get; set; } 14 | public string MakeModelName { get; set; } 15 | public int ContactId { get; set; } 16 | public string ContactName { get; set; } 17 | public DateTime? LastModified { get; set; } 18 | public DateTime Created { get; set; } 19 | public IEnumerable Scopes { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/ContactVehicleEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class ContactVehicleEditModel 10 | { 11 | public int VehicleId { get; set; } 12 | public int ContactId { get; set; } 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Automile.Net/Models/ContractsModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Xml.Serialization; 3 | 4 | namespace Automile.Net 5 | { 6 | [XmlRoot(ElementName = "getJourneys")] 7 | public class ContractTripsModel 8 | { 9 | [XmlElement("return")] 10 | public List ContractTrip { get; set; } 11 | } 12 | 13 | public class ContractTrip 14 | { 15 | [XmlElement("id")] 16 | public int Id { get; set; } 17 | 18 | [XmlElement("contractId")] 19 | public int ContractId { get; set; } 20 | 21 | [XmlElement("firstStreet")] 22 | public string FirstStreet { get; set; } 23 | 24 | [XmlElement("endStreet")] 25 | public string EndStreet { get; set; } 26 | 27 | [XmlElement("startDate")] 28 | public string StartDate { get; set; } 29 | 30 | [XmlElement("endDate")] 31 | public string EndDate { get; set; } 32 | 33 | [XmlElement("startTime")] 34 | public string StartTime { get; set; } 35 | 36 | [XmlElement("endTime")] 37 | public string EndTime { get; set; } 38 | 39 | [XmlElement("licensePlate")] 40 | public string LicensePlate { get; set; } 41 | 42 | [XmlElement("kilometers")] 43 | public decimal? Kilometers { get; set; } 44 | 45 | [XmlElement("companyId")] 46 | public int CompanyId { get; set; } 47 | 48 | [XmlElement("employeeId")] 49 | public string EmployeeId { get; set; } 50 | 51 | [XmlElement("contractNotes")] 52 | public string ContractNotes { get; set; } 53 | 54 | } 55 | 56 | [XmlRoot(ElementName = "getMyContractsResponse")] 57 | public class ContractsModel 58 | { 59 | [XmlElement("return")] 60 | public List Contacts { get; set; } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Automile.Net/Models/CreateOrderModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Automile.Net 4 | { 5 | public class CreateOrderModel 6 | { 7 | [Required(ErrorMessage = "You need to supply a company")] 8 | public string Company { get; set; } 9 | 10 | [Required(ErrorMessage = "You need to supply a first name")] 11 | public string FirstName { get; set; } 12 | 13 | [Required(ErrorMessage = "You need to supply a last name")] 14 | public string LastName { get; set; } 15 | 16 | [Required(ErrorMessage = "You need to supply a e-mail")] 17 | public string Email { get; set; } 18 | 19 | [Required(ErrorMessage = "You need to supply a number of devices")] 20 | public int NumberOfDevices { get; set; } 21 | 22 | [Required(ErrorMessage = "You need to supply a shipping street address")] 23 | public string ShippingAddress { get; set; } 24 | 25 | [Required(ErrorMessage = "You need to supply a shipping address zip code")] 26 | public string ShippingAddressZipCode { get; set; } 27 | 28 | [Required(ErrorMessage = "You need to supply a shipping address city")] 29 | public string ShippingAddressState { get; set; } 30 | 31 | [Required(ErrorMessage = "You need to supply a shipping address country")] 32 | public string ShippingAddressCountry { get; set; } 33 | 34 | [Required(ErrorMessage = "You need to supply a billing street address")] 35 | public string BillingAddress { get; set; } 36 | 37 | [Required(ErrorMessage = "You need to supply a billing address zipcode")] 38 | public string BillingAddressZipCode { get; set; } 39 | 40 | [Required(ErrorMessage = "You need to supply a billing address city")] 41 | public string BillingAddressState { get; set; } 42 | 43 | [Required(ErrorMessage = "You need to supply a billing address country")] 44 | public string BillingAddressCountry { get; set; } 45 | 46 | public bool UseShippingAddressAsBillingAddress { get; set; } 47 | 48 | [Required(ErrorMessage = "You need to supply a subscription currency")] 49 | public string SubscriptionCurrency { get; set; } 50 | 51 | 52 | [Required(ErrorMessage = "You need to supply a mobile phone number")] 53 | public string MobilePhoneNumber { get; set; } 54 | 55 | [Required(ErrorMessage = "You need to supply office phone number")] 56 | public string OfficePhoneNumber { get; set; } 57 | 58 | public int? LeadId { get; set; } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Automile.Net/Models/CreatePINModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace Automile.Net 8 | { 9 | public class CreatePinModel 10 | { 11 | public string UserName { get; set; } 12 | public string MobilePhoneNumber { get; set; } 13 | public Guid? UserGuid { get; set; } 14 | public string Culture { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Automile.Net/Models/CustomCategoryModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Automile.Net 4 | { 5 | public class CustomCategoryModel 6 | { 7 | public int CustomCategoryId { get; set; } 8 | public string Value { get; set; } 9 | } 10 | 11 | public class CustomCategoryPostModel 12 | { 13 | public int ContactId { get; set; } 14 | 15 | /// 16 | /// Custom categories to add 17 | /// 18 | public List Added { get; set; } 19 | 20 | /// 21 | /// Custom categories to delete 22 | /// 23 | public List Removed { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /Automile.Net/Models/CustomUserCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | 9 | namespace Automile.Net 10 | { 11 | public class CustomUserCreateModel 12 | { 13 | [Required(ErrorMessage = "You need to supply a username")] 14 | public string UserName { get; set; } 15 | 16 | public string FirstName { get; set; } 17 | 18 | public string LastName { get; set; } 19 | 20 | [Required(ErrorMessage = "You need to supply an e-mail address")] 21 | [EmailAddress(ErrorMessage="You need to supply a valid e-mail address")] 22 | public string EmailAddress { get; set; } 23 | 24 | public string MobilePhoneNumber { get; set; } 25 | 26 | public string Description { get; set; } 27 | 28 | public string Password { get; set; } 29 | 30 | [Required(ErrorMessage = "You need to supply an IMEI")] 31 | public string IMEI { get; set; } 32 | 33 | [Required(ErrorMessage = "You need to supply a serial number")] 34 | public string SerialNumber { get; set; } 35 | 36 | public string Culture { get; set; } 37 | 38 | public ApiUnitType? UnitType { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Automile.Net/Models/CustomUserCreateWithoutPasswordModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | 9 | namespace Automile.Net 10 | { 11 | public class CustomUserCreateWithoutPasswordModel 12 | { 13 | [Required(ErrorMessage = "You need to supply a username")] 14 | public string UserName { get; set; } 15 | 16 | public string FirstName { get; set; } 17 | 18 | public string LastName { get; set; } 19 | 20 | [Required(ErrorMessage = "You need to supply an e-mail address")] 21 | [EmailAddress(ErrorMessage="You need to supply a valid e-mail address")] 22 | public string EmailAddress { get; set; } 23 | 24 | public string MobilePhoneNumber { get; set; } 25 | 26 | public string Description { get; set; } 27 | 28 | public string Culture { get; set; } 29 | 30 | //[Required(ErrorMessage = "You need to supply an IMEI")] 31 | public string IMEI { get; set; } 32 | 33 | //[Required(ErrorMessage = "You need to supply a serial number")] 34 | public string SerialNumber { get; set; } 35 | 36 | public ApiUnitType? UnitType { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Automile.Net/Models/DeviceRegisteredModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class DeviceRegisteredModel 10 | { 11 | public string QueriedDeviceIMEI { get; set; } 12 | public bool IsRegistered { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Automile.Net/Models/DistanceCodesClearedModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | 10 | /// 11 | /// PID49 12 | /// 13 | public class DistanceCodesClearedModel 14 | { 15 | 16 | public double DistanceInKm { get; set; } 17 | 18 | public DateTime RecordTimeStamp { get; set; } 19 | 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Automile.Net/Models/DistanceMILOnModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | 10 | /// 11 | /// PID33 12 | /// 13 | public class DistanceMILOnModel 14 | { 15 | 16 | public double DistanceInKm { get; set; } 17 | 18 | public DateTime RecordTimeStamp { get; set; } 19 | 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Automile.Net/Models/EmailExpenseReportModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Automile.Net 7 | { 8 | public class EmailExpenseReportModel 9 | { 10 | public string ToEmail { get; set; } 11 | public string ISO639LanguageCode { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Automile.Net/Models/EmailExpenseReportsModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Automile.Net 4 | { 5 | public class EmailExpenseReportsModel 6 | { 7 | public int VehicleId { get; set; } 8 | public DateTime FromDate { get; set; } 9 | public DateTime ToDate { get; set; } 10 | public string ToEmail { get; set; } 11 | public string ISO639LanguageCode { get; set; } 12 | 13 | } 14 | } -------------------------------------------------------------------------------- /Automile.Net/Models/EmailTripReportModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class EmailTripReportModel 4 | { 5 | public int VehicleId { get; set; } 6 | public int Period { get; set; } 7 | public string ToEmail { get; set; } 8 | public string ISO639LanguageCode { get; set; } 9 | 10 | public bool ExcludeDetailsForPersonalTrips { get; set; } 11 | 12 | public bool ExcludeEnvironmentalAndFuelData { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Automile.Net/Models/EngineCoolantTemperatureModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | 10 | 11 | /// 12 | /// PID05 13 | /// 14 | public class EngineCoolantTemperatureModel 15 | { 16 | 17 | public double TemperatureInCelsius { get; set; } 18 | 19 | public DateTime RecordTimeStamp { get; set; } 20 | 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Automile.Net 5 | { 6 | public class ExpenseReportCreateModel 7 | { 8 | public int? VehicleId { get; set; } 9 | public int? ContactId { get; set; } 10 | public int? TripId { get; set; } 11 | public DateTime ExpenseReportDateUtc { get; set; } 12 | 13 | public List ExpenseReportRows { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportCreateModelwImage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class ExpenseReportCreateModelwImage 10 | { 11 | public int? VehicleId { get; set; } 12 | public int? ContactId { get; set; } 13 | public int? TripId { get; set; } 14 | public DateTime ExpenseReportDateUtc { get; set; } 15 | 16 | public List ExpenseReportRows { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Automile.Net 4 | { 5 | public class ExpenseReportEditModel 6 | { 7 | public int? VehicleId { get; set; } 8 | public int? ContactId { get; set; } 9 | public int? TripId { get; set; } 10 | public DateTime ExpenseReportDateUtc { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Automile.Net 5 | { 6 | public class ExpenseReportModel 7 | { 8 | public int ExpenseReportId { get; set; } 9 | public int? ContactId { get; set; } 10 | public int? VehicleId { get; set; } 11 | public int? TripId { get; set; } 12 | public DateTime ExpenseReportDateUtc { get; set; } 13 | public List ExpenseReportRows { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportRowContentCreateModel.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace Automile.Net 4 | { 5 | public class ExpenseReportRowContentCreateModel 6 | { 7 | public int ExpenseReportRowId { get; set; } 8 | public string Data { get; set; } 9 | public ApiContentType ContentType { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportRowContentCreateModelwImage.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class ExpenseReportRowContentCreateModelwImage 4 | { 5 | public int ExpenseReportRowId { get; set; } 6 | public string ImagePath { get; set; } 7 | public ApiContentType ContentType { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportRowContentEditModel.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace Automile.Net 4 | { 5 | public class ExpenseReportRowContentEditModel 6 | { 7 | public string Data { get; set; } 8 | public ApiContentType ContentType { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportRowContentModel.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace Automile.Net 4 | { 5 | public class ExpenseReportRowContentModel 6 | { 7 | public int ExpenseReportRowContentId { get; set; } 8 | public int ExpenseReportRowId { get; set; } 9 | public ApiContentType ContentType { get; set; } 10 | public string ContentFileName { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportRowCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace Automile.Net 6 | { 7 | public class ExpenseReportRowCreateModel 8 | { 9 | public int ExpenseReportId { get; set; } 10 | public decimal? AmountInCurrency { get; set; } 11 | public decimal? VATInCurrency { get; set; } 12 | public string ISO4217CurrencyCode { get; set; } 13 | public string Notes { get; set; } 14 | public ApiCategoryType Category { get; set; } 15 | public DateTime ExpenseReportRowDateUtc { get; set; } 16 | 17 | public List ExpenseReportRowContent { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportRowCreateModelwImage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Automile.Net 5 | { 6 | public class ExpenseReportRowCreateModelwImage 7 | { 8 | public int ExpenseReportId { get; set; } 9 | public decimal? AmountInCurrency { get; set; } 10 | public decimal? VATInCurrency { get; set; } 11 | public string ISO4217CurrencyCode { get; set; } 12 | public string Notes { get; set; } 13 | public ApiCategoryType Category { get; set; } 14 | public DateTime ExpenseReportRowDateUtc { get; set; } 15 | 16 | public List ExpenseReportRowContent { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportRowEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace Automile.Net 6 | { 7 | public class ExpenseReportRowEditModel 8 | { 9 | public decimal? AmountInCurrency { get; set; } 10 | public decimal? VATInCurrency { get; set; } 11 | public string ISO4217CurrencyCode { get; set; } 12 | public string Notes { get; set; } 13 | public DateTime ExpenseReportRowDateUtc { get; set; } 14 | public ApiCategoryType Category { get; set; } 15 | 16 | public List ExpenseReportRowContent { get; set; } 17 | } 18 | 19 | public class ExpenseReportRowContentUpdateEditModel 20 | { 21 | public int? ExpenseReportRowContentId { get; set; } 22 | public int ExpenseReportRowId { get; set; } 23 | public string Data { get; set; } 24 | public ApiContentType ContentType { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ExpenseReportRowModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Automile.Net 5 | { 6 | public class ExpenseReportRowModel 7 | { 8 | public int ExpenseReportRowId { get; set; } 9 | public int ExpenseReportId { get; set; } 10 | public decimal? AmountInCurrency { get; set; } 11 | public decimal? VATInCurrency { get; set; } 12 | public string ISO4217CurrencyCode { get; set; } 13 | public string Notes { get; set; } 14 | public DateTime ExpenseReportRowDateUtc { get; set; } 15 | public List ExpenseReportRowContent { get; set; } 16 | public ApiCategoryType Category { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Automile.Net/Models/FuelLevelInputModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | 10 | /// 11 | /// PID012 12 | /// 13 | public class FuelLevelInputModel 14 | { 15 | 16 | public double FuelLevelInPercentage { get; set; } 17 | 18 | public DateTime RecordTimeStamp { get; set; } 19 | 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Automile.Net/Models/GeofenceCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | 9 | namespace Automile.Net 10 | { 11 | public class GeofenceCreateModel 12 | { 13 | [Required(ErrorMessage = "You need to supply a geofence name")] 14 | public string Name { get; set; } 15 | public string Description { get; set; } 16 | [Required(ErrorMessage = "You need to supply a vehicle")] 17 | public int VehicleId { get; set; } 18 | public GeofencePolygon GeofencePolygon { get; set; } 19 | public ApiGeofenceType? GeofenceType { get; set; } 20 | public List Schedules { get; set; } 21 | } 22 | 23 | public class GeofenceScheduleAddModel 24 | { 25 | public bool Monday { get; set; } 26 | public bool Tuesday { get; set; } 27 | public bool Wednesday { get; set; } 28 | public bool Thursday { get; set; } 29 | public bool Friday { get; set; } 30 | public bool Saturday { get; set; } 31 | public bool Sunday { get; set; } 32 | public TimeSpan StartTime { get; set; } 33 | public TimeSpan EndTime { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Automile.Net/Models/GeofenceEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | 6 | namespace Automile.Net 7 | { 8 | public class GeofenceEditModel 9 | { 10 | [Required(ErrorMessage = "You need to supply a geofence name")] 11 | public string Name { get; set; } 12 | public string Description { get; set; } 13 | public GeofencePolygon GeofencePolygon { get; set; } 14 | public ApiGeofenceType? GeofenceType { get; set; } 15 | 16 | public List Schedules { get; set; } 17 | } 18 | 19 | public class GeofenceScheduleEditModel 20 | { 21 | public int? GeofenceScheduleId { get; set; } 22 | 23 | public bool Monday { get; set; } 24 | public bool Tuesday { get; set; } 25 | public bool Wednesday { get; set; } 26 | public bool Thursday { get; set; } 27 | public bool Friday { get; set; } 28 | public bool Saturday { get; set; } 29 | public bool Sunday { get; set; } 30 | public TimeSpan StartTime { get; set; } 31 | public TimeSpan EndTime { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Automile.Net/Models/GeofenceModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace Automile.Net 6 | { 7 | public class GeofenceModel 8 | { 9 | public int GeofenceId { get; set; } 10 | public string Name { get; set; } 11 | public string Description { get; set; } 12 | public GeofencePolygon GeofencePolygon { get; set; } 13 | public bool IsEditable { get; set; } 14 | public ApiGeofenceType GeofenceType { get; set; } 15 | 16 | public List Schedules { get; set; } 17 | } 18 | 19 | public class GeofenceScheduleModel 20 | { 21 | public int GeofenceScheduleId { get; set; } 22 | 23 | public bool Monday { get; set; } 24 | public bool Tuesday { get; set; } 25 | public bool Wednesday { get; set; } 26 | public bool Thursday { get; set; } 27 | public bool Friday { get; set; } 28 | public bool Saturday { get; set; } 29 | public bool Sunday { get; set; } 30 | public TimeSpan StartTime { get; set; } 31 | public TimeSpan EndTime { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Automile.Net/Models/GeofencePolygon.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Automile.Net 4 | { 5 | public class GeofencePolygon 6 | { 7 | public GeofencePolygon(IEnumerable coordinates = null) 8 | { 9 | if (coordinates != null) 10 | Coordinates = coordinates; 11 | } 12 | 13 | public IEnumerable Coordinates { get; set; } 14 | public class GeographicPosition 15 | { 16 | public double Latitude { get; set; } 17 | public double Longitude { get; set; } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Automile.Net/Models/GeofenceReportModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class GeofenceReportModel 10 | { 11 | public DateTime FromDate { get; set; } 12 | public DateTime ToDate { get; set; } 13 | 14 | public int? VehicleId { get; set; } 15 | 16 | public int? GeofenceId { get; set; } 17 | 18 | public List Result { get; set; } 19 | } 20 | public class GeofenceRecordReportModel 21 | { 22 | public int TripId { get; set; } 23 | 24 | public int GeofenceId { get; set; } 25 | 26 | public string GeofenceName { get; set; } 27 | 28 | public GeofenceType GeofenceType { get; set; } 29 | 30 | public bool IsInside { get; set; } 31 | 32 | public DateTime EventDateTime { get; set; } 33 | 34 | public VehicleTinyModel VehicleTinyModel { get; set; } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIConfigCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class IMEIConfigCreateModel 11 | { 12 | [Required] 13 | public string IMEI { get; set; } 14 | [Required] 15 | public int VehicleId { get; set; } 16 | [Required] 17 | public string SerialNumber { get; set; } 18 | 19 | public IMEIDeviceType? IMEIDeviceType { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIConfigDetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class IMEIConfigDetailModel 11 | { 12 | public int IMEIConfigId { get; set; } 13 | public string IMEI { get; set; } 14 | public int? VehicleId { get; set; } 15 | public ApiIMEIDeviceType? DeviceType { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIConfigEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class IMEIConfigEditModel 11 | { 12 | [Required] 13 | public int VehicleId { get; set; } 14 | 15 | public ApiIMEIDeviceType? IMEIDeviceType { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIDeviceType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public enum IMEIDeviceType : byte 11 | { 12 | [Description("Automile Box 1 (2G)")] 13 | AutomileBox_750 = 0, 14 | [Description("Automile Box 2 (3G)")] 15 | AutomileBox_860 = 1, 16 | [Description("Automile AnyTrack")] 17 | AutomileAnyTrack_1 = 2, 18 | [Description("Automile Mobile Tracking")] 19 | AutomileMobile = 3 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIEventDTCModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class IMEIEventDTCModel : IMEIEventModelBase 11 | { 12 | public List Dtcs { get; set; } 13 | 14 | 15 | 16 | } 17 | 18 | public class DTC 19 | { 20 | public string DTCCode { get; set; } 21 | public string FaultLocation { get; set; } 22 | public string ProbableCause { get; set; } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIEventMILModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class IMEIEventMILModel : IMEIEventModelBase 11 | { 12 | 13 | public bool MilStatus { get; set; } 14 | 15 | public int NumberOfDTCs { get; set; } // of DTCs : Total DTC codes in the vehicle. 16 | public int MILDistance { get; set; } //distance : Distance travelled while MIL is Activated (km)OperatingSystem 17 | public int CLRDistance { get; set; }// distance: Distance since diagnostic trouble codes cleared (km) 18 | public int TripDistance { get; set; } //:Accumulated trip miles since1st time device connection to above MIL info stored (km) 19 | public int MILTime { get; set; } //: Time run by the engine while MIL is activated (min) 20 | public int CLRTime { get; set; } //: Time since diagnostic trouble codes cleared (min) 21 | public int TripTime { get; set; } //:Accumulated Trip time since the 1st time device connection to above MIL info stored ( sec ): 22 | 23 | 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIEventModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class IMEIEventModel 10 | { 11 | 12 | public int IMEIEventId { get; set; } 13 | public string IMEI { get; set; } 14 | public string EventType { get; set; } 15 | public System.DateTime TimeStamp { get; set; } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIEventModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public abstract class IMEIEventModelBase 11 | { 12 | public string Description { get; set; } 13 | public DateTime TimeStamp { get; set; } 14 | public short? TimeZone { get; set; } 15 | public string EventType { get; set; } 16 | public double? PositionLongitude { get; set; } 17 | public double? PositionLatitude { get; set; } 18 | public string PositionFormattedAddress { get; set; } 19 | public int? CellTower { get; set; } 20 | public short? CellTowerTimeZone { get; set; } 21 | public string VehicleIdentificationNumber { get; set; } 22 | 23 | public string IMEI { get; set; } 24 | 25 | public String DeviceSerialNumber { get; set; } 26 | 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Automile.Net/Models/IMEIEventStatusModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class IMEIEventStatusModel : IMEIEventModelBase 11 | { 12 | public string Status { get; set; } // Connet / Disconnect 13 | //public string Description { get; set; } // The device has been connected to the vehicle 14 | 15 | //public IMEIEventStatusModel(IMEIEvent eventEntity) 16 | // : base(eventEntity) 17 | //{ 18 | // base.Description = "Device connection status"; 19 | 20 | // Status = "Device Connected"; 21 | 22 | // if(eventEntity.EventType.ToString() == "137") 23 | // Status = "Device DisConnected"; 24 | 25 | //} 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Automile.Net/Models/ImeiConfigModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class IMEIConfigModel 11 | { 12 | public int IMEIConfigId { get; set; } 13 | public string IMEI { get; set; } 14 | public int? VehicleId { get; set; } 15 | public ApiIMEIDeviceType? DeviceType { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Models/LeadActivityCreateModel.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace Automile.Net 4 | { 5 | public class LeadActivityCreateModel 6 | { 7 | public int LeadId { get; set; } 8 | public ApiLeadActionType LeadActionType { get; set; } 9 | public string ActionValue { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Automile.Net/Models/LoginModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Automile.Net 4 | { 5 | public class LoginModel 6 | { 7 | public string UserName { get; set; } 8 | 9 | public string Password { get; set; } 10 | 11 | public string ClientId { get; set; } 12 | 13 | public string Scopes { get; set; } 14 | 15 | public string RedirectUri { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /Automile.Net/Models/MonitorStatusModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | /// 11 | /// PID001 12 | /// TODO: Not complete... 13 | /// 14 | public class MonitorStatusModel 15 | { 16 | private BitArray v; 17 | public TestStatus Misfire { get; private set; } 18 | public TestStatus FuelSystem { get; private set; } 19 | public TestStatus Components { get; private set; } 20 | public bool MIL { get; private set; } 21 | 22 | //A0-A6 DTC_CNT Number of confirmed emissions-related DTCs available for display. 23 | public int ConfirmedEmissionsDtc { get; private set; } 24 | 25 | public MonitorStatusModel(Byte[] vB) 26 | { 27 | v = new BitArray(vB); 28 | 29 | DieselMIL dM; 30 | GasolineMIL gM; 31 | 32 | 33 | MIL = v[8]; 34 | 35 | Misfire.TestAvailable = v[9]; 36 | Misfire.TestInComplete = v[13]; 37 | 38 | FuelSystem.TestAvailable = v[10]; 39 | FuelSystem.TestInComplete = v[14]; 40 | 41 | Components.TestAvailable = v[11]; 42 | Components.TestInComplete = v[15]; 43 | 44 | var isDiesel = v[11]; 45 | 46 | if (isDiesel) 47 | { 48 | dM = new DieselMIL(v); 49 | } 50 | else 51 | { 52 | gM = new GasolineMIL(v); 53 | } 54 | } 55 | 56 | public bool FuelSystemMonitoringStatus { get; private set; } 57 | 58 | public class GasolineMIL 59 | { 60 | public TestStatus Catalyst { get; set; } 61 | public TestStatus HeatedCatalyst { get; set; } 62 | public TestStatus EvaporativeSystem { get; set; } 63 | public TestStatus SecondaryAirSystem { get; set; } 64 | public TestStatus A_C_Refrigerant { get; set; } 65 | public TestStatus OxygenSensor { get; set; } 66 | public TestStatus OxygenSensorHeater { get; set; } 67 | public TestStatus EGRSystem { get; set; } 68 | 69 | public GasolineMIL(BitArray v) 70 | { 71 | Catalyst.TestAvailable = v[17]; 72 | Catalyst.TestInComplete = v[25]; 73 | 74 | HeatedCatalyst.TestAvailable = v[18]; 75 | HeatedCatalyst.TestInComplete = v[26]; 76 | 77 | EvaporativeSystem.TestAvailable = v[19]; 78 | EvaporativeSystem.TestInComplete = v[27]; 79 | 80 | SecondaryAirSystem.TestAvailable = v[20]; 81 | SecondaryAirSystem.TestInComplete = v[28]; 82 | 83 | A_C_Refrigerant.TestAvailable = v[21]; 84 | A_C_Refrigerant.TestInComplete = v[29]; 85 | 86 | OxygenSensor.TestAvailable = v[22]; 87 | OxygenSensor.TestInComplete = v[30]; 88 | 89 | OxygenSensorHeater.TestAvailable = v[23]; 90 | OxygenSensorHeater.TestInComplete = v[31]; 91 | 92 | EGRSystem.TestAvailable = v[24]; 93 | EGRSystem.TestInComplete = v[32]; 94 | 95 | } 96 | } 97 | 98 | public class DieselMIL 99 | { 100 | public TestStatus NMHC_Cat { get; set; } 101 | public TestStatus NOx_SCR_Monitor { get; set; } 102 | public TestStatus Boost_Pressure { get; set; } 103 | public TestStatus Exhaust_Gas_Sensor { get; set; } 104 | public TestStatus PMFilterMonitoring { get; set; } 105 | public TestStatus EGRAndOrVVTSystem { get; set; } 106 | 107 | 108 | 109 | 110 | public DieselMIL(BitArray v) 111 | { 112 | 113 | NMHC_Cat.TestAvailable = v[17]; 114 | NMHC_Cat.TestInComplete = v[25]; 115 | 116 | NOx_SCR_Monitor.TestAvailable = v[18]; 117 | NOx_SCR_Monitor.TestInComplete = v[26]; 118 | 119 | Boost_Pressure.TestAvailable = v[20]; 120 | Boost_Pressure.TestInComplete = v[28]; 121 | 122 | Exhaust_Gas_Sensor.TestAvailable = v[22]; 123 | Exhaust_Gas_Sensor.TestInComplete = v[30]; 124 | 125 | PMFilterMonitoring.TestAvailable = v[23]; 126 | PMFilterMonitoring.TestInComplete = v[31]; 127 | 128 | EGRAndOrVVTSystem.TestAvailable = v[24]; 129 | EGRAndOrVVTSystem.TestInComplete = v[32]; 130 | } 131 | } 132 | 133 | public class TestStatus 134 | { 135 | public bool TestAvailable { get; set; } 136 | public bool TestInComplete { get; set; } 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /Automile.Net/Models/MovePushTriggers.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class MovePushTriggers 4 | { 5 | public int ToUserDeviceId { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Automile.Net/Models/PIDModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace Automile.Net 9 | { 10 | public class PIDModel 11 | { 12 | [JsonConverter(typeof(ByteArrayConverter))] 13 | public byte[] Data { get; set; } 14 | 15 | public DateTime RecordTimeStamp { get; set; } 16 | public double? Value { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Automile.Net/Models/PlaceCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | 4 | 5 | namespace Automile.Net 6 | { 7 | public class PlaceCreateModel 8 | { 9 | [Required(ErrorMessage = "You need to supply a place name")] 10 | public string Name { get; set; } 11 | 12 | [Required(ErrorMessage = "You need to supply a vehicle")] 13 | public int VehicleId { get; set; } 14 | 15 | [Required(ErrorMessage = "You need to supply a radius")] 16 | public int Radius { get; set; } 17 | 18 | [Required(ErrorMessage = "You need to supply a position point")] 19 | public PositionPointModel PositionPoint { get; set; } 20 | 21 | public string Description { get; set; } 22 | 23 | public ApiTripType? TripType { get; set; } 24 | 25 | public ApiTripTypeTrigger? TripTypeTrigger { get; set; } 26 | 27 | public int? DrivesBetweenAnotherPlaceId { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /Automile.Net/Models/PlaceEditModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | 4 | namespace Automile.Net 5 | { 6 | public class PlaceEditModel 7 | { 8 | [Required(ErrorMessage = "You need to supply a place name")] 9 | public string Name { get; set; } 10 | 11 | [Required(ErrorMessage = "You need to supply a radius")] 12 | public int Radius { get; set; } 13 | 14 | [Required(ErrorMessage = "You need to supply a position point")] 15 | public PositionPointModel PositionPoint { get; set; } 16 | 17 | public string Description { get; set; } 18 | 19 | public ApiTripType? TripType { get; set; } 20 | 21 | public ApiTripTypeTrigger? TripTypeTrigger { get; set; } 22 | 23 | public int? DrivesBetweenAnotherPlaceId { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /Automile.Net/Models/PlaceModel.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Automile.Net 3 | { 4 | public class PlaceModel 5 | { 6 | public int PlaceId { get; set; } 7 | public string Name { get; set; } 8 | public string Description { get; set; } 9 | public PositionPointModel PositionPoint { get; set; } 10 | public ApiTripType? TripType { get; set; } 11 | public ApiTripTypeTrigger? TripTypeTrigger { get; set; } 12 | public int? Radius { get; set; } 13 | public bool IsEditable { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Automile.Net/Models/PositionPointModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class PositionPointModel 4 | { 5 | public double Longitude { get; set; } 6 | public double Latitude { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Automile.Net/Models/ProOrderModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Automile.Net 4 | { 5 | public class ProOrderModel 6 | { 7 | public string ISO4217CurrencyCode { get; set; } 8 | 9 | public int NumberOfUnits { get; set; } 10 | 11 | public bool NonOBDUnits { get; set; } 12 | 13 | public bool ExtensionCables { get; set; } 14 | 15 | public int NumberOfExtensionCords { get; set; } 16 | 17 | [Required(ErrorMessage = "You need to supply a company name")] 18 | public string CompanyName { get; set; } 19 | 20 | [Required(ErrorMessage = "You need to supply a first name")] 21 | public string FirstName { get; set; } 22 | 23 | [Required(ErrorMessage = "You need to supply a last name")] 24 | public string LastName { get; set; } 25 | 26 | [Required(ErrorMessage = "You need to supply an email")] 27 | public string Email { get; set; } 28 | 29 | [Required(ErrorMessage = "You need to supply a mobile phone number")] 30 | public string MobilePhoneNumber { get; set; } 31 | 32 | public AddressModel ShippingAddress { get; set; } 33 | 34 | public bool UseShippingAddressForBillingAddress { get; set; } 35 | 36 | public AddressModel BillingAddress { get; set; } 37 | } 38 | } -------------------------------------------------------------------------------- /Automile.Net/Models/PublishSubscribeAuthenticationDataTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | 10 | public class PublishSubscribeAuthenticationData_Salesforce 11 | { 12 | public string OrganisationId { get; set; } 13 | public string InstanceUrl { get; set; } 14 | public string ClientSecret { get; set; } 15 | public string ClientId { get; set; } 16 | public string AuthCode { get; set; } 17 | public string RedirectUrl { get; set; } 18 | } 19 | 20 | public class PublishSubscribeAuthenticationData_Basic 21 | { 22 | public string Username { get; set; } 23 | public string Password { get; set; } 24 | } 25 | 26 | public class PublishSubscribeAuthenticationData_Bearer 27 | { 28 | public string BearerToken { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Automile.Net/Models/PublishSubscribeCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Automile.Net 7 | { 8 | public class PublishSubscribeCreateModel 9 | { 10 | public string PublishToUrl { get; set; } 11 | 12 | public ApiPublishType PublishType { get; set; } 13 | 14 | public int? VehicleId { get; set; } 15 | 16 | public ApiPublishSubscribeAuthenticationType AuthenticationType { get; set; } 17 | 18 | public string AuthenticationData { get; set; } 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /Automile.Net/Models/PublishSubscribeEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Automile.Net 7 | { 8 | public class PublishSubscribeEditModel 9 | { 10 | public string PublishToUrl { get; set; } 11 | 12 | public ApiPublishType PublishType { get; set; } 13 | 14 | public int? VehicleId { get; set; } 15 | 16 | public ApiPublishSubscribeAuthenticationType AuthenticationType { get; set; } 17 | 18 | public string AuthenticationData { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /Automile.Net/Models/PublishSubscribeModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Automile.Net 7 | { 8 | public class PublishSubscribeModel 9 | { 10 | public int PublishSubscribeId { get; set; } 11 | 12 | public string PublishToUrl { get; set; } 13 | 14 | public ApiPublishType PublishType { get; set; } 15 | 16 | public int? VehicleId { get; set; } 17 | 18 | public ApiPublishSubscribeAuthenticationType AuthenticationType { get; set; } 19 | 20 | public string AuthenticationData { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /Automile.Net/Models/RPMModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | /// 11 | /// PID012 12 | /// 13 | public class RPMModel 14 | { 15 | 16 | public double RPMValue { get; set; } 17 | 18 | public DateTime RecordTimeStamp { get; set; } 19 | 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Automile.Net/Models/ResetPasswordUserModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class ResetPasswordUserModel 11 | { 12 | public string Email { get; set; } 13 | public ApiResetPasswordType ResetPasswordType { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Automile.Net/Models/ReverseGeocodingResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | 9 | namespace Automile.Net 10 | { 11 | public class ReverseGeocodingResult 12 | { 13 | public string FormattedAddress { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Automile.Net/Models/SignUpModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class SignUpRequestModel 10 | { 11 | public string Email { get; set; } 12 | 13 | } 14 | 15 | public class SignUpResponseModel 16 | { 17 | public string Username { get; set; } 18 | 19 | public string Password { get; set; } 20 | 21 | public string APIClientIdentifier { get; set; } 22 | 23 | public string APIClientSecret { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Automile.Net/Models/SlackPayloadModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace Automile.Net 9 | { 10 | 11 | public class SlackOutgoingPayload 12 | { 13 | public string text { get; set; } 14 | public bool unfurl_links { get; set; } 15 | } 16 | 17 | 18 | public class SlackPayloadModel 19 | { 20 | public string token { get; set; } 21 | public string team_id { get; set; } 22 | public string channel_id { get; set; } 23 | public string channel_name { get; set; } 24 | public string user_id { get; set; } 25 | public string user_name { get; set; } 26 | public string command { get; set; } 27 | public string text { get; set; } 28 | } 29 | 30 | 31 | public class SlackIncomingWebHook 32 | { 33 | public List attachments { get; set; } 34 | 35 | } 36 | 37 | 38 | public class SlackAttachment 39 | { 40 | public string fallback { get; set; } 41 | public string text { get; set; } 42 | public string pretext { get; set; } 43 | public string color { get; set; } 44 | public List fields { get; set; } 45 | 46 | } 47 | 48 | public class SlackAttachmentField 49 | { 50 | public string title { get; set; } 51 | public string value { get; set; } 52 | 53 | [JsonProperty(PropertyName = "short")] 54 | public bool _short { get; set; } 55 | 56 | 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Automile.Net/Models/TaskModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace Automile.Net 6 | { 7 | public class TaskModel 8 | { 9 | public int TaskId { get; set; } 10 | public int CreatedByContactId { get; set; } 11 | public string CreatedByContactName { get; set; } 12 | public int? TaskAcquiredByContactId { get; set; } 13 | public string TaskAcquiredByContactName { get; set; } 14 | 15 | public int? LastMessageSentByContactId { get; set; } 16 | public string LastMessageSentByContactName { get; set; } 17 | public string LastMessageShortText { get; set; } 18 | public DateTime? LastMessageDateUtc { get; set; } 19 | public bool? LastMessageIsRead { get; set; } 20 | public string CreatedByContactImageUrl { get; set; } 21 | public string TaskAcquiredByContactImageUrl { get; set; } 22 | public ApiTaskStatusType TaskStatusType { get; set; } 23 | public ApiTaskType TaskType { get; set; } 24 | public int UnreadTaskMessages { get; set; } 25 | } 26 | 27 | public class TaskDetailModel 28 | { 29 | public int TaskId { get; set; } 30 | public int CreatedByContactId { get; set; } 31 | public string CreatedByContactName { get; set; } 32 | public int? TaskAcquiredByContactId { get; set; } 33 | public string TaskAcquiredByContactName { get; set; } 34 | 35 | public List TaskMessages { get; set; } 36 | } 37 | 38 | public class TaskMessageModel 39 | { 40 | public int TaskMessageId { get; set; } 41 | public int SentByContactId { get; set; } 42 | public int ToContactId { get; set; } 43 | public string MessageText { get; set; } 44 | public DateTime MessageSentAtUtc { get; set; } 45 | public string SentByContactName { get; set; } 46 | public string ToContactName { get; set; } 47 | public bool MessageIsRead { get; set; } 48 | 49 | public PositionModel Position { get; set; } 50 | } 51 | 52 | public class PositionModel 53 | { 54 | public double Longitude { get; set; } 55 | public double Latitude { get; set; } 56 | } 57 | 58 | public class TaskCreateModel 59 | { 60 | public ApiTaskType TaskType { get; set; } 61 | public int? ToContactId { get; set; } 62 | public string TaskMessageText { get; set; } 63 | public PositionModel Position { get; set; } 64 | } 65 | 66 | public class TaskMessageEditModel 67 | { 68 | public bool IsRead { get; set; } 69 | } 70 | 71 | public class TaskMessageCreateModel 72 | { 73 | public int TaskId { get; set; } 74 | public string MessageText { get; set; } 75 | public PositionModel Position { get; set; } 76 | } 77 | } -------------------------------------------------------------------------------- /Automile.Net/Models/TemperatureModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class TemperatureModel 11 | { 12 | public Int16 TemperatureInCelsius { get; set; } 13 | 14 | public DateTime RecordTimeStampUtc { get; set; } 15 | 16 | public float? Latitude { get; set; } 17 | 18 | public float? Longitude { get; set; } 19 | 20 | public string VehicleFriendlyName { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Automile.Net/Models/TransportstyrelsenInfoModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Automile.Net 7 | { 8 | public class TransportstyrelsenInfoModel 9 | { 10 | public bool HasInformation { get; set; } 11 | 12 | public string Make { get; set; } 13 | 14 | public string Model { get; set; } 15 | 16 | public string MakeImageUrl { get; set; } 17 | 18 | public short? ModelYear { get; set; } 19 | 20 | public string BodyStyle { get; set; } 21 | 22 | public MainFuelType? FuelType { get; set; } 23 | 24 | public TransmissionType? TransmissionType { get; set; } 25 | 26 | public bool TrailerHitch { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /Automile.Net/Models/TriggerCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | 9 | 10 | namespace Automile.Net 11 | { 12 | public class TriggerCreateModel 13 | { 14 | [Required] 15 | public int IMEIConfigId { get; set; } 16 | 17 | public ApiTriggerType TriggerType { get; set; } 18 | public string TriggerTypeData { get; set; } 19 | public string TriggerTypeData2 { get; set; } 20 | public DateTime? ValidFrom { get; set; } 21 | public DateTime? ValidTo { get; set; } 22 | public ApiDestinationType DestinationType { get; set; } 23 | 24 | [Required(ErrorMessage = "DestinationData is required")] 25 | public string DestinationData { get; set; } 26 | public ApiDeliveryType DeliveryType { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Automile.Net/Models/TriggerDetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Automile.Net 5 | { 6 | public class TriggerDetailModel 7 | { 8 | public int TriggerId { get; set; } 9 | public int IMEIConfigId { get; set; } 10 | public ApiTriggerType TriggerType { get; set; } 11 | public string TriggerTypeData { get; set; } 12 | public DateTime? ValidFrom { get; set; } 13 | public DateTime? ValidTo { get; set; } 14 | public DateTime? MutedUntilDateTime { get; set; } 15 | public int? MutedForAdditionalSeconds { get; set; } 16 | public ApiDestinationType DestinationType { get; set; } 17 | public string DestinationData { get; set; } 18 | public ApiDeliveryType DeliveryType { get; set; } 19 | public int? APIClientId { get; set; } 20 | 21 | public DateTime CreatedAt { get; set; } 22 | public string TriggerTypeData2 { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Automile.Net/Models/TriggerEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | 5 | namespace Automile.Net 6 | { 7 | public class TriggerEditModel 8 | { 9 | [Required] 10 | public int IMEIConfigId { get; set; } 11 | 12 | public ApiTriggerType TriggerType { get; set; } 13 | public string TriggerTypeData { get; set; } 14 | public string TriggerTypeData2 { get; set; } 15 | public DateTime? ValidFrom { get; set; } 16 | public DateTime? ValidTo { get; set; } 17 | public DateTime? MutedUntilDateTime { get; set; } 18 | public ApiDestinationType DestinationType { get; set; } 19 | 20 | [Required] 21 | public string DestinationData { get; set; } 22 | public ApiDeliveryType DeliveryType { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Automile.Net/Models/TriggerEditMutedUntilModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class TriggerEditMutedUntilModel 4 | { 5 | public int SecondsFromNow { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Automile.Net/Models/TriggerMessageHistoryDetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class TriggerMessageHistoryModel 11 | { 12 | public int TriggerMessageHistoryId { get; set; } 13 | public int TriggerId { get; set; } 14 | public Nullable WasSentOn { get; set; } 15 | public ApiDestinationType DestinationType { get; set; } 16 | public string DestinationData { get; set; } 17 | public string MessageData1 { get; set; } 18 | public string MessageData2 { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Automile.Net/Models/TriggerModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Automile.Net 5 | { 6 | public class TriggerModel 7 | { 8 | public int TriggerId { get; set; } 9 | public int IMEIConfigId { get; set; } 10 | public ApiTriggerType TriggerType { get; set; } 11 | public ApiDestinationType DestinationType { get; set; } 12 | public string DestinationData { get; set; } 13 | public string TriggerTypeData { get; set; } 14 | public DateTime? ValidFrom { get; set; } 15 | public DateTime? ValidTo { get; set; } 16 | public DateTime? MutedUntilDateTime { get; set; } 17 | public int? MutedForAdditionalSeconds { get; set; } 18 | public DateTime CreatedAt { get; set; } 19 | public string TriggerTypeData2 { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/TripAddNoteModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Automile.Net 4 | { 5 | public class TripAddNoteModel 6 | { 7 | public List TripTags { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Automile.Net/Models/TripDataAccelerometerEventModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Automile.Net 5 | { 6 | public class TripDataAccelerometerEventModel 7 | { 8 | public TripDataAccelerometerEventModel() 9 | { 10 | AccelerometerEvents = new List(); 11 | AccelerometerEventsSummary = new List(); 12 | } 13 | 14 | public List AccelerometerEvents { get; set; } 15 | public List AccelerometerEventsSummary { get; set; } 16 | } 17 | 18 | public class AccelerometerEventModel 19 | { 20 | public Guid? EventId { get; set; } 21 | public double? AccelerationX { get; set; } 22 | public double? AccelerationY { get; set; } 23 | public double? AccelerationZ { get; set; } 24 | public int SampleNumber { get; set; } 25 | public TripAccelerometerEventType AccelerometerEventType { get; set; } 26 | public DateTime RecordTimeStamp { get; set; } 27 | public int? IndexRelativeTimeToEvent { get; set; } 28 | } 29 | 30 | public class AccelerometerEventDetailsModel 31 | { 32 | public Guid? EventId { get; set; } 33 | public double? AccelerationX { get; set; } 34 | public double? AccelerationY { get; set; } 35 | public double? AccelerationZ { get; set; } 36 | public int SampleNumber { get; set; } 37 | public TripAccelerometerEventType AccelerometerEventType { get; set; } 38 | public DateTime RecordTimeStamp { get; set; } 39 | public int? IndexRelativeTimeToEvent { get; set; } 40 | } 41 | 42 | public class AccelerometerEventSummaryModel 43 | { 44 | public Guid? EventId { get; set; } 45 | public TripAccelerometerEventType AccelerometerEventType { get; set; } 46 | public DateTime RecordTimeStamp { get; set; } 47 | } 48 | } -------------------------------------------------------------------------------- /Automile.Net/Models/TripDataAccelerometerModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | 10 | /// 11 | /// PID05 12 | /// 13 | public class TripDataAccelerometerModel 14 | { 15 | 16 | public double? XAccelerationInG { get; set; } 17 | 18 | public double? YAccelerationInG { get; set; } 19 | 20 | public double? ZAccelerationInG { get; set; } 21 | 22 | public Byte SampleNumber { get; set; } 23 | 24 | public DateTime RecordTimeStamp { get; set; } 25 | 26 | public bool? IsNormalized { get; set; } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Automile.Net/Models/TripDetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Automile.Net 5 | { 6 | public class TripDetailModel 7 | { 8 | public int TripId { get; set; } 9 | public string IMEI { get; set; } 10 | public DateTime TripStartDateTime { get; set; } 11 | public short? TripStartTimeZone { get; set; } 12 | public int TripStartODOMeter { get; set; } 13 | public short? TripNumber { get; set; } 14 | public byte NumberOfSupportedPIDs { get; set; } 15 | public string VehicleIdentificationNumber { get; set; } 16 | public string VechicleProtocol { get; set; } 17 | public DateTime? TripEndDateTime { get; set; } 18 | public short? TripEndTimeZone { get; set; } 19 | public int? TripEndODOMeter { get; set; } 20 | public string TripStartFormattedAddress { get; set; } 21 | public string TripEndFormattedAddress { get; set; } 22 | public string TripStartCustomAddress { get; set; } 23 | public string TripEndCustomAddress { get; set; } 24 | public ApiTripType TripType { get; set; } 25 | public string TripTags { get; set; } 26 | public int? VehicleId { get; set; } 27 | public decimal? FuelInLiters { get; set; } 28 | public decimal? TripLengthInKilometers { get; set; } 29 | public int? TripLengthInMinutes { get; set; } 30 | public int? IdleTimeInSecondsAllTrip { get; set; } 31 | public int? IdleTimeInSecondsFromStart { get; set; } 32 | public short? IdleRPMMax { get; set; } 33 | public byte? MaxSpeed { get; set; } 34 | public short? MaxRPM { get; set; } 35 | public decimal? CO2EmissionInGrams { get; set; } 36 | 37 | public decimal? OdometerInKilometersAfterTripEnded { get; set; } 38 | 39 | public decimal? AverageSpeedInKilometersPerHour { get; set; } 40 | 41 | public decimal? TripStartOutsideTemperatureInCelsius { get; set; } 42 | public int? DriverContactId { get; set; } 43 | public bool HasDrivingEvents { get; set; } 44 | public string CustomCategory { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Automile.Net/Models/TripEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using Newtonsoft.Json; 5 | using Newtonsoft.Json.Linq; 6 | 7 | namespace Automile.Net 8 | { 9 | 10 | public class TripEditModel 11 | { 12 | public string CustomCategory { get; set; } 13 | 14 | public ApiTripType TripType { get; set; } 15 | 16 | public List TripTags { get; set; } 17 | 18 | public int? LastEditedByContactId { get; set; } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/TripGeoModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class TripGeoModel 10 | { 11 | public DateTime RecordTimeStamp { get; set; } 12 | 13 | public double Latitude { get; set; } 14 | 15 | public double Longitude { get; set; } 16 | 17 | public short? HeadingDegrees { get; set; } 18 | 19 | public byte? NumberOfSatellites { get; set; } 20 | 21 | public byte? HDOP { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Automile.Net/Models/TripModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class TripModel 11 | { 12 | public int TripId { get; set; } 13 | public DateTime TripStartDateTime { get; set; } 14 | public DateTime? TripEndDateTime { get; set; } 15 | public decimal? DistanceKilometers { get; set; } 16 | public decimal? FuelConsumptionInLiters { get; set; } 17 | public string TripStartFormattedAddress { get; set; } 18 | public string TripEndFormattedAddress { get; set; } 19 | public string TripStartCustomAddress { get; set; } 20 | public string TripEndCustomAddress { get; set; } 21 | public int? VehicleId { get; set; } 22 | public ApiTripType TripType { get; set; } 23 | public int? DriverContactId { get; set; } 24 | 25 | public bool HasSpeedingViolation { get; set; } 26 | public bool HasIdlingEvent { get; set; } 27 | public bool HasAccelerationEvent { get; set; } 28 | public bool HasAccident { get; set; } 29 | public bool HasTurningEvent { get; set; } 30 | public bool HasBrakingEvent { get; set; } 31 | 32 | public int? ParkedForMinutesUntilNextTrip { get; set; } 33 | public bool HasDrivingEvents { get; set; } 34 | public string CustomCategory { get; set; } 35 | public string TripTags { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Automile.Net/Models/TripStartEndGeoModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class TripStartEndGeoModel 4 | { 5 | public double? StartLatitude { get; set; } 6 | public double? StartLongitude { get; set; } 7 | public double? EndLatitude { get; set; } 8 | public double? EndLongitude { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Automile.Net/Models/TripSummaryReportModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Automile.Net 4 | { 5 | public class TripSummaryReportModel 6 | { 7 | public int ReportStartPeriod { get; set; } 8 | public int ReportEndPeriod { get; set; } 9 | public int? VehicleId { get; set; } 10 | public TripType TripType { get; set; } 11 | public decimal? DistanceInKilometers { get; set; } 12 | public int? TravelTimeInMinutes { get; set; } 13 | public decimal? FuelInLiters { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Automile.Net/Models/TripSynchronized.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class TripSynchronized 4 | { 5 | public int[] Trips { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Automile.Net/Models/UserCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Automile.Net 9 | { 10 | public class UserCreateModel 11 | { 12 | [Required(ErrorMessage = "You need to supply a username")] 13 | public string UserName { get; set; } 14 | 15 | [Required(ErrorMessage = "You need to supply a firstname")] 16 | public string FirstName { get; set; } 17 | 18 | [Required(ErrorMessage = "You need to supply a lastname")] 19 | public string LastName { get; set; } 20 | 21 | [Required(ErrorMessage = "You need to supply an e-mail address")] 22 | public string EmailAddress { get; set; } 23 | 24 | public string MobilePhoneNumber { get; set; } 25 | 26 | public string Description { get; set; } 27 | 28 | public string Password { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Automile.Net/Models/UserCreatedPasswordModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class UserCreatedPasswordModel 4 | { 5 | public string Password { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Automile.Net/Models/UserDeviceCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class UserDeviceCreateModel 11 | { 12 | public string DeviceIdentifier { get; set; } 13 | public string DeviceToken { get; set; } 14 | 15 | public ApiDeviceType DeviceType { get; set; } 16 | 17 | public string Description { get; set; } 18 | 19 | public string DeviceName { get; set; } 20 | } 21 | 22 | public class UserDeviceCreateModel2 23 | { 24 | public string DeviceIdentifier { get; set; } 25 | public string DeviceToken { get; set; } 26 | 27 | public ApiDeviceType DeviceType { get; set; } 28 | 29 | public ApiUserDeviceCertType UserDeviceCertType { get; set; } 30 | 31 | public string Description { get; set; } 32 | 33 | public string DeviceName { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Automile.Net/Models/UserDeviceEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class UserDeviceEditModel 11 | { 12 | public string DeviceIdentifier { get; set; } 13 | public string DeviceToken { get; set; } 14 | 15 | public ApiDeviceType DeviceType { get; set; } 16 | 17 | public string Description { get; set; } 18 | 19 | public string DeviceName { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/UserDeviceModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | /// 11 | /// User Device Model 12 | /// 13 | public class UserDeviceModel 14 | { 15 | public int UserDeviceId { get; set; } 16 | public string DeviceIdentifier { get; set; } 17 | public string DeviceToken { get; set; } 18 | 19 | public ApiDeviceType DeviceType { get; set; } 20 | 21 | public string Description { get; set; } 22 | 23 | public string DeviceName { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Automile.Net/Models/UserExistingPasswordModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Automile.Net 7 | { 8 | public class UserExistingPasswordModel 9 | { 10 | public bool HasPassword { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Automile.Net/Models/UserModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class UserModel 10 | { 11 | public int UserId { get; set; } 12 | public Guid UserGuid { get; set; } 13 | public string UserName { get; set; } 14 | public int ContactId { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Models/UserPhoneNumberModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Automile.Net 7 | { 8 | public class UserPhoneNumberModel 9 | { 10 | public string UserName { get; set; } 11 | 12 | public string PhoneNumber { get; set; } 13 | public Guid UserGuid { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Automile.Net/Models/UsernameTakenModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class UsernameTakenModel 4 | { 5 | public string Username { get; set; } 6 | public bool Taken { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Automile.Net/Models/UsernamesPhoneNumberModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Automile.Net 4 | { 5 | public class UsernamesPhoneNumberModel 6 | { 7 | public string UserName { get; set; } 8 | public Guid UserGuid { get; set; } 9 | public string MobilePhoneNumber { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Automile.Net/Models/ValidatePinModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace Automile.Net 8 | { 9 | public class ValidatePinModel 10 | { 11 | public string UserName { get; set; } 12 | public string Pin { get; set; } 13 | public Guid? UserGuid { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Automile.Net/Models/Vehicle2CreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | 9 | namespace Automile.Net 10 | { 11 | public class Vehicle2CreateModel 12 | { 13 | public string NumberPlate { get; set; } 14 | public string Make { get; set; } 15 | public string Model { get; set; } 16 | public short? ModelYear { get; set; } 17 | public string BodyStyle { get; set; } 18 | public int? OwnerContactId { get; set; } 19 | public int? OwnerCompanyId { get; set; } 20 | 21 | [Required] 22 | public int? CreateRelationshipToId { get; set; } 23 | 24 | [Required] 25 | public VehicleRelationshipType? VehicleRelationshipType { get; set; } 26 | 27 | // New props 28 | public string UserVehicleIdentificationNumber { get; set; } 29 | //public string NumberPlate { get; set; } 30 | //public string Make { get; set; } 31 | //public string Model { get; set; } 32 | //public int ModelYear { get; set; } 33 | //public string BodyStyle { get; set; } 34 | public ApiMainFuelType? FuelType { get; set; } 35 | public ApiTripType? DefaultTripType { get; set; } 36 | //public int OwnerContactId { get; set; } 37 | //public int? OwnerCompanyId { get; set; } 38 | 39 | public bool AllowAutomaticUpdates { get; set; } 40 | public ApiPrivacyPolicyType? DefaultPrivacyPolicyType { get; set; } 41 | public string Nickname { get; set; } 42 | 43 | public string Tags { get; set; } 44 | public int? CategoryColor { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Automile.Net/Models/Vehicle2EditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | 9 | 10 | namespace Automile.Net 11 | { 12 | public class Vehicle2EditModel 13 | { 14 | public string NumberPlate { get; set; } 15 | public string Make { get; set; } 16 | public string Model { get; set; } 17 | public short? ModelYear { get; set; } 18 | public string BodyStyle { get; set; } 19 | public int? OwnerContactId { get; set; } 20 | public int? OwnerCompanyId { get; set; } 21 | public string UserVehicleIdentificationNumber { get; set; } 22 | public ApiMainFuelType? FuelType { get; set; } 23 | public ApiTripType? DefaultTripType { get; set; } 24 | public bool AllowAutomaticUpdates { get; set; } 25 | public string FrontTyre { get; set; } 26 | public string RearTyre { get; set; } 27 | public string FrontWheelRim { get; set; } 28 | public string RearWheelRim { get; set; } 29 | public bool? TrailerHitch { get; set; } 30 | public decimal OdometerInKilometers { get; set; } 31 | public bool HasOdometerChanged { get; set; } 32 | public ApiPrivacyPolicyType? DefaultPrivacyPolicyType { get; set; } 33 | public bool? UpdateFromTransportstyrelsen { get; set; } 34 | public bool? AllowSpeedRecording { get; set; } 35 | public string Nickname { get; set; } 36 | public string Tags { get; set; } 37 | 38 | /// 39 | /// Supported colors (hex value), 40 | /// 3652794 (#37BCBA), 41 | /// 2591227 (#2789FB), 42 | /// 11430900 (#AE6BF4), 43 | /// 16478657 (#FB71C1), 44 | /// 16735053 (#FF5B4D), 45 | /// 16752644 (#FFA004), 46 | /// 16772393 (#FFED29), 47 | /// 13228106 (#C9D84A), 48 | /// 6597394 (#64AB12), 49 | /// 12096370 (#B89372) 50 | /// 51 | public int? CategoryColor { get; set; } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Automile.Net/Models/Vehicle2Model.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace Automile.Net 9 | { 10 | public class Vehicle2Model 11 | { 12 | public int VehicleId { get; set; } 13 | public string VehicleIdentificationNumber { get; set; } 14 | public string NumberPlate { get; set; } 15 | public string Make { get; set; } 16 | public string Model { get; set; } 17 | public int? OwnerContactId { get; set; } 18 | public int? OwnerCompanyId { get; set; } 19 | public decimal? CurrentOdometerInKilometers { get; set; } 20 | 21 | public string UserVehicleIdentificationNumber { get; set; } 22 | public int? ModelYear { get; set; } 23 | public string BodyStyle { get; set; } 24 | public ApiMainFuelType? FuelType { get; set; } 25 | public ApiTripType? DefaultTripType { get; set; } 26 | public bool AllowAutomaticUpdates { get; set; } 27 | public ApiPrivacyPolicyType? DefaultPrivacyPolicyType { get; set; } 28 | public int? CheckedInContactId { get; set; } 29 | public bool IsEditable { get; set; } 30 | public string MakeImageUrl { get; set; } 31 | public int? TransferIntervalInSeconds { get; set; } 32 | public bool? SampleHarshEvents { get; set; } 33 | public List Features { get; set; } 34 | public bool? AllowSpeedRecording { get; set; } 35 | public string Nickname { get; set; } 36 | 37 | public int? CategoryColor { get; set; } 38 | public string Tags { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleCheckInModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace Automile.Net 5 | { 6 | public class VehicleCheckInModel 7 | { 8 | public int? ContactId { get; set; } 9 | public int VehicleId { get; set; } 10 | public ApiTripType? DefaultTripType { get; set; } 11 | public DateTime? CheckOutAtUtc { get; set; } 12 | 13 | public ApiDeviceType UserDeviceType { get; set; } 14 | public string UserDeviceToken { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Automile.Net 9 | { 10 | public class VehicleCreateModel 11 | { 12 | public string NumberPlate { get; set; } 13 | public string Make { get; set; } 14 | public string Model { get; set; } 15 | public short? ModelYear { get; set; } 16 | public string BodyStyle { get; set; } 17 | public int? OwnerContactId { get; set; } 18 | public int? OwnerCompanyId { get; set; } 19 | 20 | [Required] 21 | public int? CreateRelationshipToId { get; set; } 22 | 23 | [Required] 24 | public VehicleRelationshipType? VehicleRelationshipType { get; set; } 25 | } 26 | 27 | 28 | public enum VehicleRelationshipType 29 | { 30 | VehicleToContact = 0, 31 | VehicleToCompany = 1 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleDefectTypeModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | 4 | namespace Automile.Net.VehicleInspection 5 | { 6 | public class VehicleDefectTypeModel 7 | { 8 | public ApiVehicleDefectType DefectType { get; set; } 9 | public Dictionary LocalizedName { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleDetailModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class VehicleDetailModel 10 | { 11 | public string VehicleIdentificationNumber { get; set; } 12 | public string NumberPlate { get; set; } 13 | public string Make { get; set; } 14 | public string Model { get; set; } 15 | public int? ModelYear { get; set; } 16 | public string BodyStyle { get; set; } 17 | public int? OwnerContactId { get; set; } 18 | public int? OwnerCompanyId { get; set; } 19 | public string OwnedByName { get; set; } 20 | public int NumberOfTrips { get; set; } 21 | public decimal? DistanceTravelledThisYear { get; set; } 22 | public decimal? DistanceTravelledLastYear { get; set; } 23 | public double? LastKnownLatitude { get; set; } 24 | public double? LastKnownLongitude { get; set; } 25 | public DateTime? LastKnownGeoTimeStamp { get; set; } 26 | public string LastKnownFormattedAddress { get; set; } 27 | public string LastKnownCustomAddress { get; set; } 28 | public double? LastKnownSpeed { get; set; } 29 | public double? LastKnownTemperature { get; set; } 30 | public DateTime? LastKnownTemperatureTimeStamp { get; set; } 31 | public double? LastTripEndLatitude { get; set; } 32 | public double? LastTripEndLongitude { get; set; } 33 | public DateTime? LastTripEndGeoTimeStamp { get; set; } 34 | public int? ParkedForNumberOfSeconds { get; set; } 35 | public int? OngoingTripId { get; set; } 36 | public string MakeImageUrl { get; set; } 37 | public decimal? CurrentOdometerInKilometers { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Automile.Net 9 | { 10 | public class VehicleEditModel 11 | { 12 | public string NumberPlate { get; set; } 13 | public string Make { get; set; } 14 | public string Model { get; set; } 15 | public short? ModelYear { get; set; } 16 | public string BodyStyle { get; set; } 17 | public int? OwnerContactId { get; set; } 18 | public int? OwnerCompanyId { get; set; } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleGeofenceCreateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Automile.Net 5 | { 6 | public class VehicleGeofenceCreateModel 7 | { 8 | [Required] 9 | public int VehicleId { get; set; } 10 | 11 | [Required] 12 | public int GeofenceId { get; set; } 13 | 14 | public DateTime? ValidFrom { get; set; } 15 | public DateTime? ValidTo { get; set; } 16 | } 17 | 18 | public class VehiclePlaceCreateModel 19 | { 20 | [Required] 21 | public int VehicleId { get; set; } 22 | 23 | [Required] 24 | public int PlaceId { get; set; } 25 | 26 | public string Description { get; set; } 27 | 28 | public ApiTripType? TripType { get; set; } 29 | 30 | public ApiTripTypeTrigger? TripTypeTrigger { get; set; } 31 | 32 | [Required(ErrorMessage = "You need to supply a radius")] 33 | public int Radius { get; set; } 34 | 35 | public int? DrivesBetweenAnotherPlaceId { get; set; } 36 | } 37 | 38 | public class VehiclePlaceEditModel 39 | { 40 | public string Description { get; set; } 41 | 42 | public ApiTripType? TripType { get; set; } 43 | 44 | public ApiTripTypeTrigger? TripTypeTrigger { get; set; } 45 | 46 | [Required(ErrorMessage = "You need to supply a radius")] 47 | public int Radius { get; set; } 48 | 49 | public int? DrivesBetweenAnotherPlaceId { get; set; } 50 | } 51 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleGeofenceEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Automile.Net 5 | { 6 | public class VehicleGeofenceEditModel 7 | { 8 | public DateTime? ValidFrom { get; set; } 9 | public DateTime? ValidTo { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleGeofenceModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Automile.Net 4 | { 5 | public class VehicleGeofenceModel 6 | { 7 | public int VehicleGeofenceId { get; set; } 8 | public int VehicleId { get; set; } 9 | public int GeofenceId { get; set; } 10 | public DateTime? ValidFrom { get; set; } 11 | public DateTime? ValidTo { get; set; } 12 | } 13 | 14 | public class VehiclePlaceModel 15 | { 16 | public int VehiclePlaceId { get; set; } 17 | public int VehicleId { get; set; } 18 | public int PlaceId { get; set; } 19 | public string Description { get; set; } 20 | 21 | public ApiTripType? TripType { get; set; } 22 | 23 | public ApiTripTypeTrigger? TripTypeTrigger { get; set; } 24 | 25 | public int Radius { get; set; } 26 | 27 | public int? DrivesBetweenAnotherPlaceId { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleHealth.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class VehicleHealth 10 | { 11 | public int VehicleId { get; set; } 12 | public int? PeriodFrom { get; set; } 13 | public int? PeriodTo { get; set; } 14 | public BatteryEventStatusType LastBatteryStatus { get; set; } 15 | public BatteryEvent LastBatteryWarning { get; set; } 16 | public List BatteryEventsForSelectedPeriod { get; set; } 17 | public MILEvent LastMILEvent { get; set; } 18 | public List MILEventsForSelectedPeriod { get; set; } 19 | public DTCEvent LastDTCEvent { get; set; } 20 | public DTCEvent LastPendingDTCEvent { get; set; } 21 | 22 | public List DTCEventsForSelectedPeriod { get; set; } 23 | public List PendingDTCEventsForSelectedPeriod { get; set; } 24 | 25 | public static BatteryEventStatusType GetBatteryStatusTypeFromEventType(int eventType) 26 | { 27 | switch (eventType) 28 | { 29 | case 132: 30 | return BatteryEventStatusType.Low; 31 | case 144: 32 | return BatteryEventStatusType.Critical; 33 | case 145: 34 | return BatteryEventStatusType.Shutdown; 35 | case 146: 36 | return BatteryEventStatusType.Normal; 37 | default: 38 | throw new ApplicationException("Unsupported battery status type"); 39 | } 40 | } 41 | } 42 | 43 | 44 | public enum BatteryEventStatusType : byte 45 | { 46 | Normal, 47 | Low, 48 | Critical, 49 | Shutdown 50 | } 51 | public enum MileageIndicatorEventStatusType : byte 52 | { 53 | Off, 54 | On 55 | } 56 | public class BatteryEvent 57 | { 58 | public DateTime Occured { get; set; } 59 | 60 | public double? Latitude { get; set; } 61 | 62 | public double? Longitude { get; set; } 63 | 64 | public BatteryEventStatusType BatteryStatus { get; set; } 65 | } 66 | 67 | public class MILEvent 68 | { 69 | public DateTime Occured { get; set; } 70 | 71 | public MileageIndicatorEventStatusType MILStatus { get; set; } 72 | 73 | public int? MILDistance { get; set; } 74 | 75 | public decimal? CLRDistanceUntilToday { get; set; } 76 | 77 | public byte? NumberOfDTCs { get; set; } 78 | 79 | public double? Latitude { get; set; } 80 | 81 | public double? Longitude { get; set; } 82 | } 83 | 84 | public class DTCEvent 85 | { 86 | public DateTime Occured { get; set; } 87 | 88 | public List DTCEventDetails { get; set; } 89 | 90 | public double? Latitude { get; set; } 91 | 92 | public double? Longitude { get; set; } 93 | } 94 | public class DTCEventDetail 95 | { 96 | public string DTC { get; set; } 97 | 98 | public string FaultLocation { get; set; } 99 | 100 | public string ProbableCause { get; set; } 101 | } 102 | 103 | 104 | 105 | } 106 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleInformationType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Automile.Net 7 | { 8 | public enum VehicleInformationType 9 | { 10 | Numberplate = 0, 11 | VIN = 1 12 | } 13 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleInspectionCreateModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace Automile.Net 6 | { 7 | public class VehicleInspectionCreateModel 8 | { 9 | public int VehicleId { get; set; } 10 | public DateTime InspectionDateUtc { get; set; } 11 | 12 | public List VehicleDefects { get; set; } 13 | } 14 | 15 | public class VehicleDefectCreateModel 16 | { 17 | public ApiVehicleDefectType DefectType { get; set; } 18 | public string Notes { get; set; } 19 | 20 | public List VehicleDefectStatus { get; set; } 21 | public List VehicleDefectAttachments { get; set; } 22 | public List VehicleDefectComments { get; set; } 23 | } 24 | 25 | public class VehicleDefectCommentsCreateModel 26 | { 27 | public int VehicleDefectId { get; set; } 28 | public string Comment { get; set; } 29 | } 30 | 31 | public class VehicleDefectCommentsEditModel 32 | { 33 | public string Comment { get; set; } 34 | } 35 | 36 | public class VehicleDefectStatusCreateModel 37 | { 38 | public ApiVehicleDefectStatusType DefectStatus { get; set; } 39 | } 40 | 41 | public class VehicleDefectAttachmentCreateModel 42 | { 43 | public ApiAttachmentType AttachmentType { get; set; } 44 | public string Data { get; set; } 45 | } 46 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleInspectionCreateModelwImage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public class VehicleInspectionCreateModelwImage 10 | { 11 | public int VehicleId { get; set; } 12 | public DateTime InspectionDateUtc { get; set; } 13 | 14 | public List VehicleDefects { get; set; } 15 | } 16 | 17 | public class VehicleDefectCreateModelwImage 18 | { 19 | public ApiVehicleDefectType DefectType { get; set; } 20 | public string Notes { get; set; } 21 | 22 | public List VehicleDefectStatus { get; set; } 23 | public List VehicleDefectAttachments { get; set; } 24 | public List VehicleDefectComments { get; set; } 25 | } 26 | 27 | 28 | public class VehicleDefectAttachmentCreateModelwImage 29 | { 30 | public ApiAttachmentType AttachmentType { get; set; } 31 | public string ImagePath { get; set; } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleInspectionEditModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | 4 | namespace Automile.Net 5 | { 6 | public class VehicleInspectionEditModel 7 | { 8 | public int VehicleId { get; set; } 9 | public ApiVehicleInspectionStatusType? InspectionStatusType { get; set; } 10 | public List VehicleDefects { get; set; } 11 | } 12 | 13 | public class VehicleDefectEditModel 14 | { 15 | public int? VehicleDefectId { get; set; } 16 | public ApiVehicleDefectType? DefectType { get; set; } 17 | public string Notes { get; set; } 18 | 19 | public ApiVehicleDefectStatusType? DefectStatusType { get; set; } 20 | public List VehicleDefectAttachments { get; set; } 21 | public List VehicleDefectComments { get; set; } 22 | } 23 | 24 | public class VehicleDefectCommentEditModel 25 | { 26 | public int? VehicleDefectCommentId { get; set; } 27 | public string Comment { get; set; } 28 | } 29 | 30 | public class VehicleDefectAttachmentEditModel 31 | { 32 | public int? VehicleDefectAttachmentId { get; set; } 33 | public ApiAttachmentType AttachmentType { get; set; } 34 | public string Data { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleInspectionExportModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class VehicleInspectionExportModel 4 | { 5 | public string ToEmail { get; set; } 6 | public string ISO639LanguageCode { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleInspectionModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace Automile.Net 6 | { 7 | public class VehicleInspectionModel 8 | { 9 | public int VehicleInspectionId { get; set; } 10 | public int VehicleId { get; set; } 11 | public int CreatedByContactId { get; set; } 12 | public ApiVehicleInspectionStatusType InspectionStatusType { get; set; } 13 | public DateTime InspectionDateUtc { get; set; } 14 | 15 | public List VehicleDefects { get; set; } 16 | public List InspectionStatus { get; set; } 17 | } 18 | 19 | public class VehicleInspectionStatusModel 20 | { 21 | public int VehicleInspectionStatusId { get; set; } 22 | public int VehicleInspectionId { get; set; } 23 | public int CreatedByContactId { get; set; } 24 | public ApiVehicleInspectionStatusType InspectionStatusType { get; set; } 25 | public DateTime StatusDateUtc { get; set; } 26 | } 27 | 28 | public class VehicleDefectModel 29 | { 30 | public int VehicleDefectId { get; set; } 31 | public int VehicleInspectionId { get; set; } 32 | public ApiVehicleDefectType DefectType { get; set; } 33 | public int CreatedByContactId { get; set; } 34 | public DateTime DefectDateUtc { get; set; } 35 | public string Notes { get; set; } 36 | public ApiVehicleDefectStatusType DefectStatusType { get; set; } 37 | 38 | public List VehicleDefectStatus { get; set; } 39 | public List VehicleDefectAttachments { get; set; } 40 | public List VehicleDefectComments { get; set; } 41 | } 42 | 43 | public class VehicleDefectStatusModel 44 | { 45 | public int VehicleDefectStatusId { get; set; } 46 | public int VehicleDefectId { get; set; } 47 | public int CreatedByContactId { get; set; } 48 | public ApiVehicleDefectStatusType DefectStatus { get; set; } 49 | public DateTime DefectStatusDateUtc { get; set; } 50 | } 51 | 52 | public class VehicleDefectCommentsModel 53 | { 54 | public int VehicleDefectCommentId { get; set; } 55 | public int VehicleDefectId { get; set; } 56 | public int CreatedByContactId { get; set; } 57 | public string Comment { get; set; } 58 | public DateTime CommentDateUtc { get; set; } 59 | } 60 | 61 | public class VehicleDefectAttachmentModel 62 | { 63 | public int VehicleDefectAttachmentId { get; set; } 64 | public int VehicleDefectId { get; set; } 65 | public byte AttachmentType { get; set; } 66 | public string AttachmentLocation { get; set; } 67 | public DateTime AttachmentDateUtc { get; set; } 68 | } 69 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleMakesModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Automile.Net 4 | { 5 | public class VehickeMakesModel 6 | { 7 | public List VehicleMakes { get; set; } 8 | } 9 | 10 | public class VehicleMakeModel 11 | { 12 | public string Make { get; set; } 13 | public string MakeUrl { get; set; } 14 | } 15 | 16 | public class VehicleModelsModel 17 | { 18 | public List VehicleModels { get; set; } 19 | } 20 | 21 | public class VehicleModelModel 22 | { 23 | public string Make { get; set; } 24 | public string Model { get; set; } 25 | //public int ModelYear { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleMetadataModel.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace Automile.Net 4 | { 5 | public class VehicleMetadataModel 6 | { 7 | public int VehicleMetadataId { get; set; } 8 | public string Value { get; set; } 9 | public ApiVehicleMetadataType Type { get; set; } 10 | } 11 | 12 | public class VehicleMetadataEditModel 13 | { 14 | public int? VehicleMetadataId { get; set; } 15 | public string Value { get; set; } 16 | public ApiVehicleMetadataType Type { get; set; } 17 | } 18 | 19 | public class VehicleMetadataCreateModel 20 | { 21 | public string Value { get; set; } 22 | public ApiVehicleMetadataType Type { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public class VehicleModel 11 | { 12 | public int VehicleId { get; set; } 13 | public string VehicleIdentificationNumber { get; set; } 14 | public string NumberPlate { get; set; } 15 | public string Make { get; set; } 16 | public string Model { get; set; } 17 | public int? OwnerContactId { get; set; } 18 | public int? OwnerCompanyId { get; set; } 19 | public decimal? CurrentOdometerInKilometers { get; set; } 20 | 21 | public string FriendlyName 22 | { 23 | get 24 | { 25 | if (string.IsNullOrWhiteSpace(this.UserFriendlyName) == false) 26 | return UserFriendlyName; 27 | 28 | string vehicleName = VehicleId.ToString(CultureInfo.InvariantCulture); 29 | 30 | if (Make != null) 31 | vehicleName = Make; 32 | 33 | if (Model != null) 34 | vehicleName = vehicleName + " " + Model; 35 | 36 | if (!string.IsNullOrEmpty(NumberPlate)) 37 | vehicleName = vehicleName + " (" + NumberPlate + ")"; 38 | 39 | return vehicleName; 40 | } 41 | } 42 | public string UserFriendlyName { get; set; } 43 | 44 | public Nullable FuelType { get; set; } 45 | 46 | public string ImageUrlMake 47 | { 48 | get 49 | { 50 | string url = "https://content.automile.se/vinlogo/placeholder.png"; 51 | if (!string.IsNullOrEmpty(Make)) 52 | url = "https://content.automile.se/vinlogo/" + Make.ToLower().Trim().Replace("ë", "e").Replace(" ", "-") + ".png"; 53 | return url; 54 | } 55 | } 56 | 57 | public Nullable ModelYear { get; set; } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleSpeedModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | 10 | /// 11 | /// PID013 12 | /// 13 | public class VehicleSpeedModel 14 | { 15 | public double SpeedKmPerHour { get; set; } 16 | public DateTime RecordTimeStamp { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleStatusModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Automile.Net 4 | { 5 | public class VehicleStatusModel 6 | { 7 | public int VehicleId { get; set; } 8 | public DateTime? LastPositionUtc { get; set; } 9 | public double? LastKnownLatitude { get; set; } 10 | public double? LastKnownLongitude { get; set; } 11 | public bool IsDriving { get; set; } 12 | public string MakeImageUrl { get; set; } 13 | public int? ParkedForNumberOfSeconds { get; set; } 14 | public int? DrivingForNumberOfSeconds { get; set; } 15 | public string LastKnownFormattedAddress { get; set; } 16 | public string LastKnownStreetAddress { get; set; } 17 | public string LastKnownCity { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleSummaryModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class VehicleSummaryModel : VehiclesSummaryModel 4 | { 5 | public int VehicleId { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehicleTinyModel.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public class VehicleTinyModel 4 | { 5 | public int VehicleId { get; set; } 6 | 7 | public string NumberPlate { get; set; } 8 | 9 | public string Make { get; set; } 10 | 11 | public string Model { get; set; } 12 | 13 | public string FriendlyName { get; set; } 14 | 15 | public MainFuelType? FuelType { get; set; } 16 | 17 | public short? ModelYear { get; set; } 18 | public string ImageUrlMake { get; set; } 19 | public string UserFriendlyName { get; set; } 20 | 21 | public static VehicleTinyModel PopulateModel(VehicleModel vehicle) 22 | { 23 | VehicleTinyModel model = new VehicleTinyModel(); 24 | model.VehicleId = vehicle.VehicleId; 25 | model.NumberPlate = vehicle.NumberPlate; 26 | model.Make = vehicle.Make; 27 | model.Model = vehicle.Model; 28 | model.FriendlyName = vehicle.FriendlyName; 29 | model.UserFriendlyName = vehicle.UserFriendlyName; 30 | model.FuelType = vehicle.FuelType; 31 | model.ImageUrlMake = vehicle.ImageUrlMake; 32 | model.ModelYear = vehicle.ModelYear; 33 | return model; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Automile.Net/Models/VehiclesSummaryModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Automile.Net 4 | { 5 | public class VehiclesSummaryModel 6 | { 7 | public VehiclesSummaryModel() 8 | { 9 | DistanceReports = new List(); 10 | FuelReports = new List(); 11 | TravelTimeReports = new List(); 12 | CO2Reports = new List(); 13 | IdleTimeReports = new List(); 14 | } 15 | 16 | public List DistanceReports { get; set; } 17 | public List FuelReports { get; set; } 18 | public List TravelTimeReports { get; set; } 19 | public List CO2Reports { get; set; } 20 | public List IdleTimeReports { get; set; } 21 | 22 | public class DistanceReportModel : VehicleSummaryReportBase 23 | { 24 | public decimal? BusinessDistanceInKilometers { get; set; } 25 | public decimal? PersonalDistanceInKilometers { get; set; } 26 | public decimal? OtherDistanceInKilometers { get; set; } 27 | 28 | } 29 | 30 | public class FuelReportModel : VehicleSummaryReportBase 31 | { 32 | public decimal? BusinessFuelInLiters { get; set; } 33 | public decimal? PersonalFuelInLiters { get; set; } 34 | public decimal? OtherFuelInLiters { get; set; } 35 | } 36 | 37 | public class TravelTimeReportModel : VehicleSummaryReportBase 38 | { 39 | public int? BusinessTravelTimeInMinutes { get; set; } 40 | public int? PersonalTravelTimeInMinutes { get; set; } 41 | public int? OtherTravelTimeInMinutes { get; set; } 42 | } 43 | 44 | public class CO2ReportModel : VehicleSummaryReportBase 45 | { 46 | public decimal? BusinessCO2InGrams { get; set; } 47 | public decimal? PersonalCO2InGrams { get; set; } 48 | public decimal? OtherCO2InGrams { get; set; } 49 | } 50 | 51 | public class IdleTimeReportModel : VehicleSummaryReportBase 52 | { 53 | public int? BusinessIdleTimeInMinutes { get; set; } 54 | public int? PersonalIdleTimeInMinutes { get; set; } 55 | public int? OtherIdleTimeInMinutes { get; set; } 56 | 57 | } 58 | } 59 | 60 | public class VehicleSummaryReportBase 61 | { 62 | public int Period { get; set; } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Automile.Net/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Automile.Net")] 9 | [assembly: AssemblyDescription("Automile SDK for .NET")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Automile Inc")] 12 | [assembly: AssemblyProduct("Automile.Net")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("124b7e38-6425-48f3-8042-62ab15ba5f99")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.3.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiApplicationType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiApplicationType 4 | { 5 | iOSiPhone = 0, 6 | iOSiPad = 1, 7 | WindowsPhone = 2, 8 | WindowsTablet = 3, 9 | Android = 4, 10 | AndroidTablet = 5 11 | } 12 | } -------------------------------------------------------------------------------- /Automile.Net/Types/ApiCategoryType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiCategoryType 4 | { 5 | Fuel = 0, 6 | SpareParts = 1, 7 | Parking = 2, 8 | Toll = 4, 9 | Other = 3, 10 | } 11 | } -------------------------------------------------------------------------------- /Automile.Net/Types/ApiContentType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiContentType 4 | { 5 | Image = 0, 6 | Pdf = 1, 7 | Voice = 2, 8 | Excel = 3, 9 | Word = 4, 10 | } 11 | } -------------------------------------------------------------------------------- /Automile.Net/Types/ApiDeliveryType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiDeliveryType : byte 4 | { 5 | Once = 0, 6 | EveryTrip = 1, 7 | Continously = 2, 8 | Other = 3 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiDestinationType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiDestinationType : byte 4 | { 5 | Email = 1, 6 | Sms = 2, 7 | HttpPost = 3, 8 | Voice = 4, 9 | MobilePush = 5, 10 | Timeline = 6, 11 | Inbox = 7, 12 | Slack = 8 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiDeviceType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum ApiDeviceType : byte 10 | { 11 | Apple = 0, 12 | Android = 1, 13 | WindowsPhone = 2 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiGeofenceType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum ApiGeofenceType 10 | { 11 | Outside = 0, 12 | Inside = 1, 13 | OutsideAndInside = 2, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiIMEIDeviceType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiIMEIDeviceType 4 | { 5 | AutomileBox_750 = 0, 6 | AutomileBox_860 = 1, 7 | AutomileAnyTrack_1 = 2, 8 | AutomileMobile = 3 9 | } 10 | } -------------------------------------------------------------------------------- /Automile.Net/Types/ApiImageType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiImageType 4 | { 5 | Small = 0, 6 | Large = 1, 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiLeadActionType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiLeadActionType : byte 4 | { 5 | SentSMS = 0, 6 | SentEmail = 1, 7 | VisitedLeadUrl = 2, 8 | VisitedTryNow = 3, 9 | MadeOrder = 4, 10 | Unsubscribed = 5, 11 | SentSMSThanksForIntrest = 6 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiMainFuelType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiMainFuelType : byte 4 | { 5 | Diesel = 0, 6 | Petrol = 1, 7 | Ethanol = 2, 8 | Gas = 3, 9 | Hybrid = 4, 10 | Electric = 5, 11 | Methane = 6, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiMapType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiMapType : byte 4 | { 5 | Mapbox = 0, 6 | Google = 1, 7 | Apple = 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiPrivacyPolicyType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiPrivacyPolicyType 4 | { 5 | SaveNoRoute = 1, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiPublishSubscribeAuthenticationType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiPublishSubscribeAuthenticationType : byte 4 | { 5 | NoneAnonymous = 0, 6 | BasicUsernameAndPassword = 1, 7 | BearerToken = 2, 8 | Salesforce = 3 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiPublishType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiPublishType : byte 4 | { 5 | JsonDefault = 0 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiResetPasswordType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiResetPasswordType 4 | { 5 | Sms = 0, 6 | Email = 1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiRoleTypeInCompany.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiRoleTypeInCompany : byte 4 | { 5 | Administrator = 0, 6 | FleetManager = 1, 7 | DispatchmentAgent = 2, 8 | CommercialDriver = 3, 9 | BusinessDriver = 4, 10 | PayrollTeam = 5 11 | } 12 | } -------------------------------------------------------------------------------- /Automile.Net/Types/ApiTaskStatusType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum ApiTaskStatusType 10 | { 11 | Open = 0, 12 | Closed = 1, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiTaskType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum ApiTaskType 10 | { 11 | Message = 0, 12 | Task = 1, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiTransmissionType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiTransmissionType : byte 4 | { 5 | Manual = 0, 6 | Automatic = 1, 7 | Variomatic = 2, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiTriggerType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiTriggerType : byte 4 | { 5 | FirmwareConfigurationUpdate = 0, 6 | FirstTripWelcomeMessage = 1, 7 | MILStatusOnOff = 2, 8 | DTCCodes = 3, 9 | DeviceConnect = 4, 10 | DeviceDisconnect = 5, 11 | DiagnosticError = 6, 12 | DiagnosticError2 = 7, 13 | DeviceStillNotConnected = 8, 14 | EngineCoolantTemperatureThresholdReached = 9, 15 | SpeedNotification = 10, 16 | VehicleInformationFound = 11, 17 | BatteryShutdown = 12, 18 | Geofence = 13, 19 | MonthlyTripJournalReport = 14, 20 | TripEnd = 15, 21 | TripStart = 16, 22 | OdometerEnd = 17, 23 | Accident = 18, 24 | VehicleInspectionPeriodStartReminder = 20, 25 | VehicleInspectionInPeriodReminder = 21, 26 | SummaryOfFirstTrips = 22, 27 | OdometerEvent = 24, 28 | WeatherForecast = 25, 29 | PendingDTCCodes = 26, 30 | TripWithUnknownDriver = 36, 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiTripType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiTripType : byte 4 | { 5 | Business = 0, 6 | Personal = 1, 7 | Other = 2, 8 | Auto = 3 9 | } 10 | 11 | public enum ApiTripTypeTrigger : byte 12 | { 13 | Start = 0, 14 | End = 1, 15 | DrivesBetween = 2, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiUnitType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiUnitType 4 | { 5 | Metric = 0, 6 | Imperial = 1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiUserDeviceCertType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum ApiUserDeviceCertType : byte 10 | { 11 | IOSProduction = 0, 12 | IOSDeveloper = 1, 13 | IOSEnterpriseProduction = 3, 14 | IOSEnterpriseDeveloper = 4 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Automile.Net/Types/ApiVehicleMetadataType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiVehicleMetadataType : byte 4 | { 5 | Tag = 0, 6 | } 7 | } -------------------------------------------------------------------------------- /Automile.Net/Types/ApiVehicleOwnerType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum ApiVehicleOwnerType 4 | { 5 | Indvidual = 0, 6 | CorporateUser = 1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Automile.Net/Types/AttachmentType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum ApiAttachmentType 10 | { 11 | Image = 0, 12 | PDF = 1, 13 | DOCX = 2, 14 | EXCEL = 3 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Automile.Net/Types/FuelType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | using System.ComponentModel; 8 | 9 | namespace Automile.Net 10 | { 11 | public enum MainFuelType : byte 12 | { 13 | Diesel = 0, 14 | Petrol = 1, 15 | Ethanol = 2, 16 | Gas = 3, 17 | Hybrid = 4, 18 | Electric = 5, 19 | Methane = 6, 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Automile.Net/Types/GeofenceType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum GeofenceType : byte 10 | { 11 | Outside = 0, 12 | Inside = 1, 13 | OutsideAndInside = 2 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Automile.Net/Types/OwnerType.cs: -------------------------------------------------------------------------------- 1 | namespace Automile.Net 2 | { 3 | public enum OwnerType : byte 4 | { 5 | Indvidual = 0, 6 | CorporateUser = 1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Automile.Net/Types/TransmissionType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Automile.Net 9 | { 10 | public enum TransmissionType : byte 11 | { 12 | Manual = 0, 13 | Automatic = 1, 14 | Variomatic = 2, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Automile.Net/Types/TripAccelerometerEventType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum TripAccelerometerEventType : byte 10 | { 11 | PositiveXAxis = 0x01, 12 | NegativeXAxis = 0x10, 13 | PositiveYAxis = 0x02, 14 | NegativeYAxis = 0x20, 15 | PositiveZAxis = 0x04, 16 | NegativeZAxis = 0x40, 17 | XHistogramData = 0x08, 18 | YHistogramData = 0x80, 19 | ZHistogramData = 0x88, 20 | ATHistogramData = 0x00, 21 | } 22 | } -------------------------------------------------------------------------------- /Automile.Net/Types/TripDrivingEventType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Automile.Net 8 | { 9 | public enum TripDrivingEventType : byte 10 | { 11 | TurnForgiving = 0, 12 | TurnAgressive = 1, 13 | TurnVeryAgressive = 2, 14 | DecelerationForgiving = 3, 15 | DecelerationAgressive = 4, 16 | DecelerationVeryAgressive = 5, 17 | AccelerationForgiving = 6, 18 | AccelerationAgressive = 7, 19 | AccelerationVeryAgressive = 8, 20 | RoadConditionForgiving = 9, 21 | RoadConditionWorse = 10, 22 | RoadConditionDisaster = 11, 23 | AccidentSide = 12, 24 | AccidentFrontBack = 13 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Automile.Net/Types/TripType.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Automile.Net 3 | { 4 | public enum TripType : byte 5 | { 6 | Business = 0, 7 | Personal = 1, 8 | Other = 2 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Automile.Net/Types/VehicleInspectionTypes.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Automile.Net 3 | { 4 | public enum ApiVehicleInspectionStatusType : byte 5 | { 6 | SubmittedWithoutDefects = 0, 7 | SubmittedWithDefects = 1, 8 | Reviewed = 2, 9 | ScheduledRepair = 3, 10 | Archived = 4, 11 | NotReviewed = 5, 12 | SafeToDrive = 6, 13 | NotSafeToDrive = 7, 14 | } 15 | 16 | public enum ApiVehicleDefectType : byte 17 | { 18 | Other = 0, 19 | AirCompressor = 1, 20 | AirLines = 2, 21 | Battery = 3, 22 | BrakeAccessories = 4, 23 | Brakes = 5, 24 | Clutch = 6, 25 | Defroster = 7, 26 | DriveLine = 8, 27 | Engine = 9, 28 | FifthWheel = 10, 29 | FrontAxle = 11, 30 | FuelTanks = 12, 31 | Heater = 13, 32 | Horn = 14, 33 | Lights = 15, 34 | Mirrors = 16, 35 | Muffler = 17, 36 | OilPressure = 18, 37 | OnBoardRecorder = 19, 38 | Radiator = 20, 39 | RearEnd = 21, 40 | Reflectors = 22, 41 | SafetyEquipment = 23, 42 | Springs = 24, 43 | Starter = 25, 44 | Steering = 26, 45 | Tires = 27, 46 | Transmission = 28, 47 | Wheel = 29, 48 | Windows = 30, 49 | WindshieldWipers = 31, 50 | } 51 | 52 | public enum ApiVehicleDefectStatusType : byte 53 | { 54 | NotResolved = 0, 55 | Resolved = 1, 56 | } 57 | } -------------------------------------------------------------------------------- /Automile.Net/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/Newtonsoft.Json.9.0.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automile/automile-net/4bf51cc15e62ee95b7315ad08c12479e59ee4d3d/packages/Newtonsoft.Json.9.0.1/Newtonsoft.Json.9.0.1.nupkg -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/lib/net20/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automile/automile-net/4bf51cc15e62ee95b7315ad08c12479e59ee4d3d/packages/Newtonsoft.Json.9.0.1/lib/net20/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/lib/net35/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automile/automile-net/4bf51cc15e62ee95b7315ad08c12479e59ee4d3d/packages/Newtonsoft.Json.9.0.1/lib/net35/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/lib/net40/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automile/automile-net/4bf51cc15e62ee95b7315ad08c12479e59ee4d3d/packages/Newtonsoft.Json.9.0.1/lib/net40/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/lib/net45/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automile/automile-net/4bf51cc15e62ee95b7315ad08c12479e59ee4d3d/packages/Newtonsoft.Json.9.0.1/lib/net45/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automile/automile-net/4bf51cc15e62ee95b7315ad08c12479e59ee4d3d/packages/Newtonsoft.Json.9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automile/automile-net/4bf51cc15e62ee95b7315ad08c12479e59ee4d3d/packages/Newtonsoft.Json.9.0.1/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automile/automile-net/4bf51cc15e62ee95b7315ad08c12479e59ee4d3d/packages/Newtonsoft.Json.9.0.1/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.9.0.1/tools/install.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | # open json.net splash page on package install 4 | # don't open if json.net is installed as a dependency 5 | 6 | try 7 | { 8 | $url = "http://www.newtonsoft.com/json/install?version=" + $package.Version 9 | $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) 10 | 11 | if ($dte2.ActiveWindow.Caption -eq "Package Manager Console") 12 | { 13 | # user is installing from VS NuGet console 14 | # get reference to the window, the console host and the input history 15 | # show webpage if "install-package newtonsoft.json" was last input 16 | 17 | $consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow]) 18 | 19 | $props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor ` 20 | [System.Reflection.BindingFlags]::NonPublic) 21 | 22 | $prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1 23 | if ($prop -eq $null) { return } 24 | 25 | $hostInfo = $prop.GetValue($consoleWindow) 26 | if ($hostInfo -eq $null) { return } 27 | 28 | $history = $hostInfo.WpfConsole.InputHistory.History 29 | 30 | $lastCommand = $history | select -last 1 31 | 32 | if ($lastCommand) 33 | { 34 | $lastCommand = $lastCommand.Trim().ToLower() 35 | if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json")) 36 | { 37 | $dte2.ItemOperations.Navigate($url) | Out-Null 38 | } 39 | } 40 | } 41 | else 42 | { 43 | # user is installing from VS NuGet dialog 44 | # get reference to the window, then smart output console provider 45 | # show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation 46 | 47 | $instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor ` 48 | [System.Reflection.BindingFlags]::NonPublic) 49 | 50 | $consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor ` 51 | [System.Reflection.BindingFlags]::NonPublic) 52 | 53 | if ($instanceField -eq $null -or $consoleField -eq $null) { return } 54 | 55 | $instance = $instanceField.GetValue($null) 56 | 57 | if ($instance -eq $null) { return } 58 | 59 | $consoleProvider = $consoleField.GetValue($instance) 60 | if ($consoleProvider -eq $null) { return } 61 | 62 | $console = $consoleProvider.CreateOutputConsole($false) 63 | 64 | $messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor ` 65 | [System.Reflection.BindingFlags]::NonPublic) 66 | if ($messagesField -eq $null) { return } 67 | 68 | $messages = $messagesField.GetValue($console) 69 | if ($messages -eq $null) { return } 70 | 71 | $operations = $messages -split "==============================" 72 | 73 | $lastOperation = $operations | select -last 1 74 | 75 | if ($lastOperation) 76 | { 77 | $lastOperation = $lastOperation.ToLower() 78 | 79 | $lines = $lastOperation -split "`r`n" 80 | 81 | $installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1 82 | 83 | if ($installMatch) 84 | { 85 | $dte2.ItemOperations.Navigate($url) | Out-Null 86 | } 87 | } 88 | } 89 | } 90 | catch 91 | { 92 | try 93 | { 94 | $pmPane = $dte2.ToolWindows.OutputWindow.OutputWindowPanes.Item("Package Manager") 95 | 96 | $selection = $pmPane.TextDocument.Selection 97 | $selection.StartOfDocument($false) 98 | $selection.EndOfDocument($true) 99 | 100 | if ($selection.Text.StartsWith("Attempting to gather dependencies information for package 'Newtonsoft.Json." + $package.Version + "'")) 101 | { 102 | # don't show on upgrade 103 | if (!$selection.Text.Contains("Removed package")) 104 | { 105 | $dte2.ItemOperations.Navigate($url) | Out-Null 106 | } 107 | } 108 | } 109 | catch 110 | { 111 | # stop potential errors from bubbling up 112 | # worst case the splash page won't open 113 | } 114 | } 115 | 116 | # still yolo --------------------------------------------------------------------------------