//
// © 2018-2020 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "IoTTransport.h"

@class MockDispatcher;

typedef void(^MockDispatcherDidConfigure)(MockDispatcher *dispatcher);

typedef void(^MockDispatcherDidGetResource)(MockDispatcher *dispatcher,
                                            IoTQueryParams params,
                                            IoTTransportDispatcherCompletion callback,
                                            dispatch_queue_t queue);

typedef void(^MockDispatcherDidPostResource)(MockDispatcher *dispatcher,
                                             IoTQueryParams params,
                                             IoTWrappedRepresentation *wrapped,
                                             IoTTransportDispatcherCompletion callback,
                                             dispatch_queue_t queue);

typedef void(^MockDispatcherDidObserveResourceChange)(MockDispatcher *dispatcher,
                                                      IoTQueryParams params,
                                                      IoTTransportDispatcherObserveCompletion callback,
                                                      dispatch_queue_t queue);

@interface MockDispatcher : NSObject <IoTTransportDispatcher>

@property (nonatomic, readonly) NSString *host;
@property (nonatomic, readonly) NSString *uri;
@property (nonatomic, readonly) NSString *resourceType;
@property (nonatomic, readonly) NSArray<NSString *> *interfaces;
@property (nonatomic, readonly) BOOL observable;

- (instancetype)initWithDidConfigureCallback:(MockDispatcherDidConfigure)configureCallback
                                 getCallback:(MockDispatcherDidGetResource)getCallback
                                postCallback:(MockDispatcherDidPostResource)postCallback
                             observeCallback:(MockDispatcherDidObserveResourceChange)observeCallback;

@end
