//
//  WS1Config.h
//  VMWare
//
//  Created by Kieran Crawford on 8/20/19.
//  Copyright © 2020 VMWare. All rights reserved.
//

#ifndef WS1Config_h
#define WS1Config_h

#import <Foundation/Foundation.h>

@class WS1Filter;

NS_ASSUME_NONNULL_BEGIN

/*!
 *@class WS1Config
 * This object is used to specify various configuration options to WS1Intelligence.
 * Once this object is setup, you can pass it to [WS1Intelligence enableWithAppID:andConfig:].
 * After WS1Intelligence is initialized, changes to this object will have no affect.
 */
@interface WS1Config : NSObject

/*!
 * Determines whether Service Monitoring should capture network performance
 * information for network calls made through NSURLConnection.
 * Default value: YES
 */
@property (nonatomic, assign) BOOL monitorNSURLConnection;

/*!
 * Determines whether Service Monitoring should capture network performance
 * information for network calls made through NSURLSession.
 * Default value: YES
 */
@property (nonatomic, assign) BOOL monitorNSURLSession;

/*!
 * Determines whether the client will send data to Apteligent while on a cellular network
 * Default value: YES
 */
@property (nonatomic) BOOL allowsCellularAccess;

/*!
 * Determine whether Service Monitoring should capture network performance
 * information for network calls made through a UIWebView or WKWebView. Currently
 * only page loads and page transitions are captured. Calls made via javascript
 * are currently not captured.
 *
 *
 * UIWebView and WKWebView monitoring are disabled on tvOS
 * The default value is "disabled" because use of the UIWebView or WKWebView
 * class has the side effect of calling [UIWebView initialize] or
 * [WKWebView initialize], both of which create new threads to manage webviews.
 * Since WS1Intelligence cannot prevent these side effects from happening and many
 * apps do not use webviews, service monitoring for webviews must be explicitly
 * enabled.
 *
 * Default value: NO
 */
@property (nonatomic, assign) BOOL monitorWKWebView;

/*!
 * Determines whether WS1Intelligence service monitoring is enabled at all.
 * If this flag is set to NO, then no instrumentation will be installed AND
 * the thread that sends service monitoring data will be disabled.
 * Default value: YES (enabled)
 */
@property (nonatomic, assign) BOOL enableServiceMonitoring;

/*!
 * An array of WS1Filter objects. These filters are used to make it so certain
 * network performance information is not reported to WS1Intelligence, for example
 * URLs that may contain sensitive information. These filters can also be used
 * to prevent URL query parameters from being stripped out (by default all query
 * parameters are removed before being sent to WS1Intelligence).
 */
@property (nonatomic, strong) NSArray<WS1Filter *> *urlFilters;

/*!
 * By default mach exception handling is enabled.  This allows capturing additional
 * crashes such as stack overflows. Since installing a mach exception handler can
 * interfere with debuggers, this setting will not take effect when a debugger is attached.
 * You may choose to disable mach exception handling if you have some code that
 * already handles mach exceptions.
 *
 * This configuration is always disabled in tvOS, setting it YES in tvOS will have no effect.
 */
@property (nonatomic, assign) BOOL enableMachExceptionHandling;

/*!
 * This enhances support for iMessage extensions. This configuration flag should be
 * set prior to initializing the SDK from inside the iMessage extension.
 */
@property (nonatomic, assign) BOOL iMessageExtension;

/*!
 * This enhances support for today extensions. This configuration flag should be
 * set prior to initializing the SDK from inside the today extension.
 */
@property (nonatomic, assign) BOOL todayExtension;

/*!
 * Creates a new WS1Config object with the default values for the above
 * properties. You can modify the config values and pass this object into
 * [WS1Intelligence enableWithAppID:andConfig]
 * @return WS1Config with default values
 */
+ (WS1Config *)defaultConfig;

/*! @return a print out of all config settings*/
- (NSString *)description;

@end

NS_ASSUME_NONNULL_END

#endif /* WS1Config_h */

