Skip to content

Commit

Permalink
update vb.net SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Olman62 committed Sep 20, 2021
1 parent baa47b8 commit d8b19ce
Show file tree
Hide file tree
Showing 26 changed files with 571 additions and 9 deletions.
Binary file modified .vs/Route4Me Route Optimization Examples/v16/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Namespace Route4MeSDKTest.Examples
.Limit = 10,
.Filter = New FilterDetails() With {
.Display = "all",
.Scheduled_for_YYMMDD = New String() {startDate, endDate}
.Scheduled_for_YYYYMMDD = New String() {startDate, endDate}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"optimize": "Distance",
"travel_mode": "Driving",
"rt": false,
"locked_last": true,
"lock_last": false,
"algorithm_type": 9,
"bundling": null,
"advanced_constraints": [
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions Route4MeSDKLibrary/DataTypes/Order.vb
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,18 @@ Namespace Route4MeSDK.DataTypes
<DataMember(Name:="visited_count", EmitDefaultValue:=False)>
Public Property membVisitedCount As Integer

''' <summary>
''' Route address stop type. For available values see Enums.AddressStopType
''' </summary>
<DataMember(Name:="address_stop_type")>
Public Property AddressStopType As String

''' <summary>
''' System-wide unique code, which permits end-users (recipients)
''' to track the status of their order.
''' </summary>
<DataMember(Name:="tracking_number", EmitDefaultValue:=False)>
Public Property TrackingNumber As String

End Class
End Namespace
33 changes: 33 additions & 0 deletions Route4MeSDKLibrary/DataTypes/OrderTerritories.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Imports System.Runtime.Serialization
Imports Route4MeSDKLibrary.Route4MeSDK.QueryTypes

Namespace Route4MeSDK.DataTypes

''' <summary>
''' Order Territories for an optimization payload.
''' </summary>
<DataContract>
Public NotInheritable Class OrderTerritories
Inherits GenericParameters

''' <summary>
''' If true, split each territory to own optimization
''' </summary>
<DataMember(Name:="split_territories", EmitDefaultValue:=False)>
Public Property SplitTerritories As Boolean?

''' <summary>
''' An array of the territory IDs
''' </summary>
<DataMember(Name:="territories_id", EmitDefaultValue:=False)>
Public Property TerritoriesId As String()

''' <summary>
''' Order filters.
''' </summary>
<DataMember(Name:="filters", EmitDefaultValue:=False)>
Public Property filters As FilterDetails

End Class

End Namespace
14 changes: 13 additions & 1 deletion Route4MeSDKLibrary/QueryTypes/OptimizationParameters.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Imports System.Runtime.Serialization

Namespace Route4MeSDK.QueryTypes


<DataContract> _
Public NotInheritable Class OptimizationParameters
Inherits GenericParameters
Expand Down Expand Up @@ -58,6 +57,13 @@ Namespace Route4MeSDK.QueryTypes
<HttpQueryMemberAttribute(Name:="state", EmitDefaultValue:=False)>
Public Property State As UInteger?

''' <summary>
''' If true, the response contains only optimization_problem_id
''' </summary>
<IgnoreDataMember>
<HttpQueryMemberAttribute(Name:="id_only", EmitDefaultValue:=False)>
Public Property IdOnly As Boolean?

''' <summary>
''' If true will be redirected
''' </summary>
Expand Down Expand Up @@ -89,5 +95,11 @@ Namespace Route4MeSDK.QueryTypes
<DataMember(Name:="depots", EmitDefaultValue:=False)>
Public Property Depots As Address()

''' <summary>
''' The order territories containing addresses for an optimization process.
''' </summary>
<DataMember(Name:="order_territories")>
Public Property OrderTerritories As OrderTerritories

End Class
End Namespace
14 changes: 13 additions & 1 deletion Route4MeSDKLibrary/QueryTypes/OrderFilterParameters.vb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Namespace Route4MeSDK.QueryTypes
Public Class FilterDetails
Inherits GenericParameters

''' <summary>
''' A query text for the orders searching.
''' </summary>
<DataMember(Name:="query")>
Public Property Query As String

''' <summary>
''' Available values: "all", "routed", "unrouted"
''' </summary>
Expand All @@ -39,7 +45,13 @@ Namespace Route4MeSDK.QueryTypes
''' e.g. ["2019-06-01", "2019-06-18"]
''' </summary>
<DataMember(Name:="scheduled_for_YYMMDD")>
Public Property Scheduled_for_YYMMDD As String()
Public Property Scheduled_for_YYYYMMDD As String()

''' <summary>
''' An array of the tracking numbers to filter the orders by tracking numbers.
''' </summary>
<DataMember(Name:="tracking_numbers")>
Public Property TrackingNumbers As String()

End Class
End Namespace
25 changes: 24 additions & 1 deletion Route4MeSDKLibrary/Route4MeManager.vb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,30 @@ Namespace Route4MeSDK
#Region "Optimizations"

Public Function RunOptimization(optimizationParameters As OptimizationParameters, ByRef errorString As String) As DataObject
Dim result = GetJsonObjectFromAPI(Of DataObject)(optimizationParameters, R4MEInfrastructureSettings.ApiHost, HttpMethodType.Post, False, errorString)
Dim result = GetJsonObjectFromAPI(Of DataObject)(
optimizationParameters,
R4MEInfrastructureSettings.ApiHost,
HttpMethodType.Post, False,
errorString)

Return result
End Function

''' <summary>
''' Generates optimized routes by order territories.
''' </summary>
''' <param name="optimizationParameters">The input parameters for the routes optimization, which encapsulates:
''' the route parameters, addresses and order territories. </param>
''' <param name="errorString">Returned error string in case of an optimization processs failing</param>
''' <returns>An array of the optimization problem and smart optimization problem objects</returns>
Public Function RunOptimizationByOrderTerritories(ByVal optimizationParameters As OptimizationParameters,
ByRef errorString As String) As DataObject()
Dim result = GetJsonObjectFromAPI(Of DataObject())(
optimizationParameters,
R4MEInfrastructureSettings.ApiHost,
HttpMethodType.Post,
False,
errorString)

Return result
End Function
Expand Down
1 change: 1 addition & 0 deletions Route4MeSDKLibrary/Route4MeSDKLibrary.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<Compile Include="DataTypes\OrderCustomField.vb" />
<Compile Include="DataTypes\OrderCustomFieldCreateResponse.vb" />
<Compile Include="DataTypes\OrdersResponse.vb" />
<Compile Include="DataTypes\OrderTerritories.vb" />
<Compile Include="DataTypes\ReadOnlyAttribute.vb" />
<Compile Include="DataTypes\Route.vb" />
<Compile Include="DataTypes\Route4MeDynamicClass.vb" />
Expand Down
Binary file modified Route4MeSDKLibrary/bin/Appveyor/Route4MeSDKLibrary.dll
Binary file not shown.
Binary file modified Route4MeSDKLibrary/bin/Appveyor/Route4MeSDKLibrary.pdb
Binary file not shown.
Loading

0 comments on commit d8b19ce

Please sign in to comment.