Skip to content

Commit

Permalink
update c# SDK (.net framework)
Browse files Browse the repository at this point in the history
  • Loading branch information
Olman62 committed Mar 27, 2021
1 parent 033c1fa commit 51db712
Show file tree
Hide file tree
Showing 90 changed files with 270,511 additions and 102 deletions.
Binary file modified .vs/Route4MeSDK/v16/.suo
Binary file not shown.
Binary file modified .vs/Route4MeSDK/v16/TestStore/0/testlog.manifest
Binary file not shown.
52 changes: 51 additions & 1 deletion Route4MeSDKLibrary/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public static class R4MEInfrastructureSettings

public const string CustomNoteType = MainHost + "/api.v4/note_custom_types.php";

public const string TeleamticsVendorsHost = "https://telematics.route4me.com/api/vendors.php";
public const string TelematicsVendorsHost = "https://telematics.route4me.com/api/vendors.php";
public const string TelematicsRegisterHost = MainHost + "/api.v4/telematics/register.php";
public const string TelematicsConnection = MainHost + "/api.v4/telematics/connections.php";
public const string TelematicsVendorsInfo = MainHost + "/api.v4/telematics/vendors.php";

public const string MemberCapabilities = MainHost + "/api/member/capabilities.php";

Expand Down Expand Up @@ -110,6 +113,8 @@ public static class R4MEInfrastructureSettingsV5

public const string DriverReview = MainHost + "/driver-reviews";

public const string AccountProfile = MainHost + "/profile-api";

#region Vehicles

public const string Vehicles = MainHost + "/vehicles";
Expand All @@ -128,6 +133,51 @@ public static class R4MEInfrastructureSettingsV5

#endregion

#region Telematics Platform

public const string StagingHost = "https://virtserver.swaggerhub.com/Route4Me/telematics-gateway/1.0.0";

public const string TelematicsConnection = StagingHost+"/connections";
public const string TelematicsConnectionVehicles = StagingHost + "/connections/{connection_token}/vehicles";

public const string TelematicsAccessToken = StagingHost + "/access-tokens";
public const string TelematicsAccessTokenSchedules = StagingHost + "/access-token-schedules";
public const string TelematicsAccessTokenScheduleItems = StagingHost + "/access-token-schedules/{schedule_id}/items";

public const string TelematicsVehicleGroups = StagingHost + "/vehicle-groups";
public const string TelematicsVehicleGroupsRelation = StagingHost + "/vehicle-groups/{vehicle_group_id}/{relation}";
public const string TelematicsVehiclesRelation = StagingHost + "/vehicles/{vehicle_id}/{relation}";

public const string TelematicsInfoMembers = StagingHost + "/info/members";
public const string TelematicsInfoVehicles = StagingHost + "/info/vehicles";
public const string TelematicsInfoVehicle = StagingHost + "/info/vehicle/{vehicle_id}/track";
public const string TelematicsInfoModules = StagingHost + "/info/members";

public const string TelematicsAddresses = StagingHost + "/addresses";

public const string TelematicsErrors = StagingHost + "/errors";

public const string TelematicsCustomerNotifications = StagingHost + "​/customers​/{customer_id}​/notifications​";
public const string TelematicsCustomers = StagingHost + "/customers";
public const string TelematicsCustomerId = StagingHost + "/customers/{customer_id}";

public const string TelematicsNotificationScheduleItems = StagingHost + "/notification-schedules/{notification_schedule_id}/items";
public const string TelematicsNotificationSchedules = StagingHost + "/notification-schedules";
public const string TelematicsNotificationScheduleId = StagingHost + "/notification-schedules/{schedule_id}";
public const string TelematicsOneTimeNotifications = StagingHost + "​/one-time-notifications";

public const string TelematicsMember = StagingHost;

public const string TelematicsMemberModules = StagingHost + "​/user-activated-modules";

public const string TelematicsMemberModuleId = StagingHost + "​/user-activated-modules/{module_id}";
public const string TelematicsMemberModuleVehicles = StagingHost + "​​/user-activated-modules​/{module_id}​/vehicles";
public const string TelematicsMemberModuleVehicleId = StagingHost + "​​​/user-activated-modules​/{module_id}​/vehicles​/{vehicle_id}";

public const string TelematicsVendors = StagingHost + "​/vendors";
public const string TelematicsVendorId = StagingHost + "​​/vendors​/{vendor_id}";

#endregion

#endregion
}
Expand Down
24 changes: 24 additions & 0 deletions Route4MeSDKLibrary/DataTypes/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,5 +343,29 @@ public enum AddressBundlingAdditionalItemsMode : uint
InheritFromPrimary = 3
}

/// <summary>
/// Telematics vendor types
/// </summary>
public enum TelematicsVendorType : uint
{
[Description("tomtom")]
Tomtom,

[Description("teletrac")]
Teletrac,

[Description("azuga")]
Azuga,

[Description("geotab")]
Geotab,

[Description("silentpassenger")]
SilentPassenger,

[Description("new_teletrac")]
NewTeletrac
}

#endregion
}
111 changes: 111 additions & 0 deletions Route4MeSDKLibrary/DataTypes/TelematicsConnection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Route4MeSDK.QueryTypes;

namespace Route4MeSDKLibrary.DataTypes
{
/// <summary>
/// The response structure from the endpoint /connections
/// </summary>
[DataContract]
public sealed class TelematicsConnection : GenericParameters
{
/// <summary>
/// Telematics connection access account_id
/// </summary>
[DataMember(Name = "account_id", EmitDefaultValue = false)]
public string AccountId { get; set; }

/// <summary>
/// Telematics connection access username
/// </summary>
[DataMember(Name = "username", EmitDefaultValue = false)]
public string UserName { get; set; }

/// <summary>
/// Telematics connection access password
/// </summary>
[DataMember(Name = "password", EmitDefaultValue = false)]
public string Password { get; set; }

/// <summary>
/// Telematics connection access host
/// </summary>
[DataMember(Name = "host", EmitDefaultValue = false)]
public string Host { get; set; }

/// <summary>
/// Telemetics connection type ID
/// </summary>
[DataMember(Name = "vendor_id", EmitDefaultValue = false)]
public int? VendorId { get; set; }

/// <summary>
/// Telemetics connection name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }

/// <summary>
/// Vehicle tracking interval in seconds
/// </summary>
[DataMember(Name = "vehicle_position_refresh_rate", EmitDefaultValue = false)]
public int? VehiclePositionRefreshRate { get; set; }

/// <summary>
/// Telematics connection access token
/// </summary>
[DataMember(Name = "connection_token", EmitDefaultValue = false)]
public string ConnectionToken { get; set; }

/// <summary>
/// Connection user ID
/// </summary>
[DataMember(Name = "user_id", EmitDefaultValue = false)]
public int? UserId { get; set; }

/// <summary>
/// When the connection updated
/// </summary>
[DataMember(Name = "updated_at", EmitDefaultValue = false)]
public string UpdatedAt { get; set; }

/// <summary>
/// When the connection created
/// </summary>
[DataMember(Name = "created_at", EmitDefaultValue = false)]
public string CreatedAt { get; set; }

/// <summary>
/// Telemetics connection ID
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public int? Id { get; set; }

/// <summary>
/// Metadata, custom key-value storage.
/// </summary>
[DataMember(Name = "metadata", EmitDefaultValue = false)]
public Dictionary<string, string> Metadata { get; set; }

/// <summary>
/// Total vehicles count
/// </summary>
[DataMember(Name = "total_vehicles_count", EmitDefaultValue = false)]
public int? TotalVehiclesCount { get; set; }

/// <summary>
/// Syncronized vehicles count
/// </summary>
[DataMember(Name = "synced_vehicles_count", EmitDefaultValue = false)]
public int? SyncedVehiclesCount { get; set; }

/// <summary>
/// Telemetics connection vendor <see cref="Enum.TelematicsVendorType" />
/// </summary>
[DataMember(Name = "vendor", EmitDefaultValue = false)]
public string Vendor { get; set; }

}
}
36 changes: 36 additions & 0 deletions Route4MeSDKLibrary/DataTypes/TelematicsRegisterMemberResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Runtime.Serialization;

namespace Route4MeSDK.DataTypes
{
/// <summary>
/// Response from the process of a telematics member registering.
/// </summary>
[DataContract]
public sealed class TelematicsRegisterMemberResponse
{
/// <summary>
/// API token
/// Use for the operations: Get Telematics Connections, Register Telematics Connection
/// </summary>
[DataMember(Name = "api_token", EmitDefaultValue = false)]
public string ApiToken { get; set; }

/// <summary>
/// When the registered member updated
/// </summary>
[DataMember(Name = "updated_at", EmitDefaultValue = false)]
public string UpdatedAt { get; set; }

/// <summary>
/// When the registered member created
/// </summary>
[DataMember(Name = "created_at", EmitDefaultValue = false)]
public string CreatedAt { get; set; }

/// <summary>
/// Telemetics member ID
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = false)]
public int? Id { get; set; }
}
}
6 changes: 0 additions & 6 deletions Route4MeSDKLibrary/DataTypes/TelematicsVendor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ public sealed class TelematicsVendor
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }

/// <summary>
/// Vendor title.
/// </summary>
[DataMember(Name = "title", EmitDefaultValue = false)]
public string Title { get; set; }

/// <summary>
/// Vendor slug.
/// </summary>
Expand Down
28 changes: 26 additions & 2 deletions Route4MeSDKLibrary/DataTypes/TelematicsVendors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Route4MeSDK.DataTypes
{
/// <summary>
/// Telematics vendor's data structure.
/// Telematics vendors list item data structure.
/// </summary>
[DataContract]
public sealed class TelematicsVendors
Expand All @@ -26,16 +26,40 @@ public sealed class TelematicsVendors
[DataMember(Name = "slug", EmitDefaultValue = false)]
public string Slug { get; set; }

/// <summary>
/// Description of the telematics vendor
/// </summary>
[DataMember(Name = "description", EmitDefaultValue = false)]
public string Description { get; set; }

/// <summary>
/// URL to the telematics vendor's logo.
/// </summary>
[DataMember(Name = "logo_url", EmitDefaultValue = false)]
public string logoURL { get; set; }
public string LogoURL { get; set; }

/// <summary>
/// URL to the telematics vendor's website.
/// </summary>
[DataMember(Name = "website_url", EmitDefaultValue = false)]
public string WebsiteURL { get; set; }

/// <summary>
/// URL to the telematics vendor's website.
/// </summary>
[DataMember(Name = "api_docs_url", EmitDefaultValue = false)]
public string ApiDocsURL { get; set; }

/// <summary>
/// Whether, the vendor is or not integrated into the Route4Me system.
/// </summary>
[DataMember(Name = "is_integrated", EmitDefaultValue = false)]
public string isIntegrated { get; set; }

/// <summary>
///Telematics vendor size (e.g. 'global', regional', 'local')
/// </summary>
[DataMember(Name = "size", EmitDefaultValue = false)]
public string Size { get; set; }
}
}
41 changes: 41 additions & 0 deletions Route4MeSDKLibrary/DataTypes/V5/AccountProfile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Runtime.Serialization;

namespace Route4MeSDK.DataTypes.V5
{
/// <summary>
/// Account profile
/// </summary>
[DataContract]
public sealed class AccountProfile
{
/// <summary>
/// Account profile email
/// </summary>
[DataMember(Name = "email", EmitDefaultValue = false)]
public string Email { get; set; }

/// <summary>
/// Acount member ID
/// </summary>
[DataMember(Name = "member_id", EmitDefaultValue = false)]
public int? MemberIId { get; set; }

/// <summary>
/// Account API key
/// </summary>
[DataMember(Name = "api_key", EmitDefaultValue = false)]
public string ApiKey { get; set; }

/// <summary>
/// Account root member ID
/// </summary>
[DataMember(Name = "root_member_id", EmitDefaultValue = false)]
public int? RootMemberId { get; set; }

/// <summary>
/// Prefered unnits of the account
/// </summary>
[DataMember(Name = "preferred_units", EmitDefaultValue = false)]
public string PreferredUnits { get; set; }
}
}
24 changes: 24 additions & 0 deletions Route4MeSDKLibrary/DataTypes/V5/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -448,4 +448,28 @@ public enum VehicleWeightUnits
[Description("t")]
Tonne
}

/// <summary>
/// Telematics vendor types
/// </summary>
public enum TelematicsVendorType : uint
{
[Description("tomtom")]
Tomtom,

[Description("teletrac")]
Teletrac,

[Description("azuga")]
Azuga,

[Description("geotab")]
Geotab,

[Description("silentpassenger")]
SilentPassenger,

[Description("new_teletrac")]
NewTeletrac
}
}
Loading

0 comments on commit 51db712

Please sign in to comment.