//
//  BackendServer.h
//  Mingle
//
//  Created by Nookaraju Maddila on 12/8/16.
//  Copyright © 2016 Infor Global Solutions Inc, Alpharetta, USA. All rights reserved.
//

#import <Foundation/Foundation.h>
//typedef NS_ENUM(unsigned int, BackendServerAuthentication)
//{
//    BackendServerAuthenticationBasic = 0,
//    BackendServerAuthenticationWindows = 1,
//    BackendServerAuthenticationIFSorADFS = 2,
//    BackendServerAuthenticationKerberos = 3,
//    BackendServerAuthenticationOAuth = 4,
//};
//
//typedef NS_ENUM(unsigned int, BackendServerAuthenticationStatus)
//{
//    BackendServerAuthenticationStatusNone,
//    BackendServerAuthenticationStatusAuthenticating,
//    BackendServerAuthenticationStatusAuthenticated,
//};
//
//typedef NS_ENUM(unsigned int, BackendServerArchitecture)
//{
//    BackendServerArchitectureService,
//    BackendServerArchitectureClassic
//};


@interface BackendServer : NSObject

// PROPERTIES
@property (nonatomic, strong) NSString *hostUrl;
@property (nonatomic, strong) NSString *port;

//@property (nonatomic) BackendServerArchitecture architecture;

@property (nonatomic, assign) BOOL isCloudServer;
@property (nonatomic) BOOL isManaged;

-(BOOL)isServerEqualTo:(BackendServer *)backendServer;
-(BOOL)isSPServerEqualTo:(BackendServer *)backendServer;
-(BOOL)isSameAs:(BackendServer *)backendServer;
-(BOOL)isHavingOAuthHostUrl:(NSString *)pu tenant:(NSString *)tenant oautherisationEndPoint:(NSString *)oautherisationEndPoint tokenEndPoint:(NSString *)tokenEndPoint revokeEndPoint:(NSString *)revokeEndPoint organization:(NSString *)organization ionAPI:(NSString *)IONAPI;

-(instancetype)initWithDictionary:(NSDictionary *)dictServer;
@property (nonatomic, assign) BOOL isDefaultServer;
@property (nonatomic, assign) BOOL isManualEntry;

//
//// AUTHENTICATION
//@property (nonatomic) BackendServerAuthentication authentication;
//@property (nonatomic) BackendServerAuthenticationStatus authenticationStatus;

// INFOR OAuth
@property (nonatomic, strong) NSString *name;
@property(nonatomic,strong) NSString *client_id;
@property(nonatomic,strong) NSString *client_secret;
@property(nonatomic,strong) NSString *oauth_host_url;
@property(nonatomic,strong) NSString *ion_api_host_url;
@property(nonatomic,strong) NSString *tenant; // shared
@property(nonatomic,strong) NSString *redirect_url;
@property(nonatomic,strong) NSString *selectedID;
@property(nonatomic,strong) NSString *oAuthEP;
@property(nonatomic,strong) NSString *oTokenEP;
@property(nonatomic,strong) NSString *oRevokeEP;
@property(nonatomic,strong) NSString *ev;
@property(nonatomic,strong) NSString *org;
@property(nonatomic,strong) NSString *ionAPI;
@property(nonatomic,strong) NSArray *scopes;

// for manual entries
@property(nonatomic,strong) NSString *guid;

-(BOOL) isProfileHaveEndPointsValues;
-(NSDictionary *) getEndPointsDictionary;
-(BOOL) hasValidSPServerInfo;
-(NSDictionary *) getDictionaryRepresentation;
@end
