Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactoring: Address, AssignVehicle, DriversScheduleswithTerritoriesV… #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

r4m-juan
Copy link
Collaborator

…3, GetOrdersByCustomFields, OrdersManager, PickupDropoffJoint, RoutingManager, TelematicsGetVendorInfo, TelematicsManager

…3, GetOrdersByCustomFields, OrdersManager, PickupDropoffJoint, RoutingManager, TelematicsGetVendorInfo, TelematicsManager
Copy link
Collaborator Author

@r4m-juan r4m-juan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r4m-cristianv Please check my comments

@@ -160,7 +160,7 @@ public static void main(String[] args) {
optParameters.setAddresses(addresses);

try {
DataObject responseObject = manager.runOptimization(optParameters);
DataObject responseObject = manager.runOptimizationWithRedirect0(optParameters);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r4m-cristianv

This is not needed we have this method:

public RoutingManager(String apiKey, boolean disableRedirects) {
    super(apiKey, disableRedirects);
}

to disabled redirects

https://github.com/route4me/route4me-java-sdk/blob/008e6a9e0c59899a8a3c7102d3cf9e46ba27552c/src/main/java/com/route4me/sdk/services/routing/RoutingManager.java#L48C1-L50C6

When that method is used we do this:

        if (this.disableRedirects) {
            builder.addParameter("redirect", "0");
            client = HttpClients.custom().disableRedirectHandling().build();
        }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right, I missed this

@@ -22,8 +22,8 @@ public static void main(String[] args) {
TelematicsManager manager = new TelematicsManager(apiKey);

try {
TelematicsVendorsInfo vendor = manager.getTelematicsVendorInfo("3");
System.out.println(vendor.getVendor());
TelematicsVendorInfo vendor = manager.getTelematicsVendorInfo("3", "62f6197505da3f545c4fc9cb87ae76c9");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r4m-cristianv Why you added this uuid key here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting unauthorized access error, that is why I added this api token, but now I double checked and the test passed without api token, so I removed it

@@ -65,6 +65,12 @@ public DataObject runOptimization(OptimizationParameters parameters) throws APIE
URIBuilder builder = Manager.defaultBuilder(OPTIMIZATION_EP);
return this.makeJSONRequest(RequestMethod.POST, builder, parameters, DataObject.class);
}

public DataObject runOptimizationWithRedirect0(OptimizationParameters parameters) throws APIException {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed @r4m-cristianv

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants