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

#import "RCTConvert+HereSDKDemandRidePreferences.h"
#import <HereSDKDemandKit/HereSDKDemandRidePreferences.h>

static const NSString *HereSDKDemandRidePreferencesSubscribeToMessages = @"subscribeToMessages";

@implementation RCTConvert (HereSDKDemandRidePreferences)

+ (HereSDKDemandRidePreferences *)HereSDKDemandRidePreferences:(id)json
{
    json = [self NSDictionary:json];
    return [HereSDKDemandRidePreferences
                ridePreferencesWithSubscribeToMessages:[self BOOL:json[HereSDKDemandRidePreferencesSubscribeToMessages]]];
}

+ (NSDictionary *)DictionaryHereSDKDemandRidePreferences:(HereSDKDemandRidePreferences *)object
{
    return @{
                HereSDKDemandRidePreferencesSubscribeToMessages : @(object.subscribeToMessages)
             };
}

@end
