/***************************************************************
 * Copyright © 2017 HERE Global B.V. All rights reserved. *
 **************************************************************/

#import "HereSDKDemandRoute+JSDictionary.h"
#import "HereSDKDemandLocation+JSDictionary.h"

@implementation HereSDKDemandRoute (JSDictionary)

+ (HereSDKDemandRoute *)routeFromJSParams:(NSDictionary *)params
{
    HereSDKDemandLocation *pickupLocation = [HereSDKDemandLocation locationFromJSParams:[params objectForKey:@"pickup"]];
    HereSDKDemandLocation *dropoffLocation = [HereSDKDemandLocation locationFromJSParams:[params objectForKey:@"destination"]];
    HereSDKDemandRoute *route = [[HereSDKDemandRoute alloc] initWithPickupLocation:pickupLocation destinationLocation:dropoffLocation];
    return route;
}

@end
