//
//  MVMCoreSessionObject.h
//  MVMCore
//
//  Created by Pfeil, Scott Robert on 11/22/17.
//  Copyright © 2017 myverizon. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MVMCoreSessionObject : NSObject <NSURLSessionTaskDelegate>

// the session used for all requests.
@property (nullable, strong, nonatomic) NSURLSession *session;

// the session used for all Freebee requests.
@property (nullable, strong, nonatomic) NSURLSession *freeBeeSession;

// The server base url (Until prepay is native, this will always be postpay).
@property (nullable, strong, nonatomic) NSURL *baseURL;

// The context root to use on the base url.
@property (nullable, strong, nonatomic) NSString *contextRoot;


// Returns the shared instance of this singleton
+ (nullable instancetype)sharedGlobal;

// Creates the nsurlsession with default configuration and no delegate. Can subclass for different session.
- (nonnull NSURLSession *)createNSURLSession;

// Gets inital parameters for request parameters.
- (nullable NSDictionary *)getInitialParameters;
// Gets inital parameters for request parameters excluding any items given a list of key names.
- (nullable NSDictionary *)getInitialParametersExcludingSections:(nullable NSSet<NSString *> *)excludeSections;

// Restarts the application session state. Can clear variables and pass a page type if needed.
- (void)restartSessionWithPageType:(nullable NSString *)pageType parameters:(nullable NSDictionary *)parameters clearAllVariables:(BOOL)clearAllVariables;

// Redirect, leaving the current app experience.
- (void)redirectWithInfo:(nullable NSDictionary *)dictionary;

// Clears the session singleton. Creates a new session NSURLSession also.
- (void)clearSessionObject;

@end
