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

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

@class IoTBaseResourceClient;
@class IoTWrappedRepresentation;

NS_ASSUME_NONNULL_BEGIN

typedef void(^IoTBaseResourceClientCompletion)(IoTWrappedRepresentation *rep, BOOL status);

@interface IoTBaseResourceClient : NSObject

@property(nonatomic,copy,readonly) NSString * host;

- (instancetype)init NS_UNAVAILABLE;

- (instancetype)initWithHost:(NSString *)host
                  dispatcher:(nullable id<IoTTransportDispatcher>)dispatcher NS_DESIGNATED_INITIALIZER;

- (BOOL)getWithQueryParameters:(IoTQueryParams)params
                    completion:(nullable IoTBaseResourceClientCompletion)completion
               completionQueue:(dispatch_queue_t)completionQueue;

- (BOOL)postAttributes:(IoTWrappedRepresentation *)packed
       queryParameters:(IoTQueryParams)params
            completion:(nullable IoTBaseResourceClientCompletion)completion
       completionQueue:(dispatch_queue_t)completionQueue;

- (BOOL)startObservingWithQueryParameters:(IoTQueryParams)params
                               didObserve:(IoTBaseResourceClientCompletion)didObserve
                             observeQueue:(dispatch_queue_t)observeQueue;

- (void)stopObserving;

- (BOOL)isGetSupported;

- (BOOL)isPostSupported;

- (BOOL)isObserveSupported;

@end

NS_ASSUME_NONNULL_END
