Пример #1
0
 internal DataCenterService(Authentication authentication, IServiceInvoker serviceInvoker, GroupService groupService, AccountService accountService, BillingService billingService)
     : base(authentication, serviceInvoker)
 {
     this.groupService = groupService;
     this.accountService = accountService;
     this.billingService = billingService;
 }
Пример #2
0
 /// <summary>
 /// Constructor called after an authentication request has succeeded. The AuthenticationInfo object
 /// contains properties for Account Alias and BearerToken.
 /// </summary>
 /// <param name="authenticationInfo"></param>
 public Client(Authentication authenticationInfo)
 {
     if (authenticationInfo != null)
     {
         UserIsAuthenticated = true;
         Authentication = authenticationInfo;
         InitializeServices();
     }
     else
     {
         UserIsAuthenticated = false;
     }
 }
Пример #3
0
        /// <summary>
        /// Constructor called when the user needs to be authenticated. It sets the userInfo and authenticationInfo fields
        /// that can then be accessed by the corresponding readonly properties. The UserInfo for User Info display and the AuthenticationInfo
        /// for subsequent calls to the API after the authentication has succeeded.
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        public Client(string userName, string password)
        {
            UserIsAuthenticated = false;

            var userInfo = AuthenticateUser(userName, password).Result;

            if (userInfo != null)
            {
                UserIsAuthenticated = true;
                Authentication = new Authentication() 
                { 
                    AccountAlias = userInfo.AccountAlias, 
                    BearerToken = userInfo.BearerToken, 
                    LocationAlias = userInfo.LocationAlias,                    
                    Roles = userInfo.Roles
                };

                InitializeServices();
            }
            else
            {
                UserIsAuthenticated = false;
            }
        }
Пример #4
0
 public static void Login(TestContext testContext)
 {
     client = new Client("mario.mamalis", "MarioTest!");
     authentication = client.Authentication;
 }
Пример #5
0
 internal GroupService(Authentication authentication, IServiceInvoker serviceInvoker, ServerService serverService)
     : base(authentication, serviceInvoker)
 {
     this.serverService = serverService;
 }
Пример #6
0
        internal ServerService(Authentication authentication, IServiceInvoker serviceInvoker)
            : base(authentication, serviceInvoker)
        {

        }
Пример #7
0
 protected ServiceBase(Authentication authentication, IServiceInvoker serviceInvoker)
 {
     this.authentication = authentication;
     this.serviceInvoker = serviceInvoker;
 }
Пример #8
0
        internal AccountService(Authentication authentication, IServiceInvoker serviceInvoker)
            : base(authentication, serviceInvoker)
        {

        }
Пример #9
0
 internal QueueService(Authentication authentication, IServiceInvoker serviceInvoker)
     : base(authentication, serviceInvoker)
 {
     this.authentication = authentication;
 }