/// <summary>
        /// Gets the list of sender's domains from provider.
        /// </summary>
        /// <returns>
        /// The <see cref="CloudSenderDomainsInfo"/>.
        /// </returns>
        public CloudSenderDomainsInfo SenderDomainsInfo()
        {
            var request = new BaseServiceRequest {
                ApiKey = ApiKey
            };

            return(ServiceClient.Post <CloudSenderDomainsInfo>(request, SenderDomainsInfoApiPath));
        }
        /// <summary>
        /// Validate an API key and respond to a ping
        /// </summary>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        public string Ping()
        {
            ServiceClient.ContentType = RequestContentType.Json;
            var request = new BaseServiceRequest {
                ApiKey = ApiKey
            };

            return(ServiceClient.Post <string>(request, PingApiPath));
        }
Exemplo n.º 3
0
        public async Task <GroupResponse> GetGroupsAsync(GroupParameters parameters)
        {
            BaseServiceRequest <GroupResponse> baseService = new BaseServiceRequest <GroupResponse>();
            var r = await baseService.GetRequest(new GroupRequest()
            {
                parameters = parameters
            });

            return(r);
        }
Exemplo n.º 4
0
        public async Task <MenuResponse> GetMenusAsync(MenuParameters parameters)
        {
            BaseServiceRequest <MenuResponse> baseService = new BaseServiceRequest <MenuResponse>();
            var r = await baseService.GetRequest(new MenuRequest()
            {
                parameters = parameters
            });

            return(r);
        }
Exemplo n.º 5
0
        public async Task <bool> UpdateUserAsync(User model)
        {
            BaseServiceRequest <UserResponse> baseService = new BaseServiceRequest <UserResponse>();
            var r = await baseService.GetRequest(new UserUpdateRequest()
            {
                id = model.Id, Entity = model
            }, Method.POST);

            return(r.success);
        }
Exemplo n.º 6
0
        public async Task <DictionariesResponse> GetDictionariesAsync(DictionariesParameters parameters)
        {
            BaseServiceRequest <DictionariesResponse> baseService = new BaseServiceRequest <DictionariesResponse>();
            var r = await baseService.GetRequest(new DictionariesRequest()
            {
                parameters = parameters
            });

            return(r);
        }
Exemplo n.º 7
0
        public async Task <LoginUserAuthResponse> LoginUserAuthAsync(string account)
        {
            BaseServiceRequest <LoginUserAuthResponse> baseService = new BaseServiceRequest <LoginUserAuthResponse>();
            var r = await baseService.GetRequest(new UserLoginAuthRequest()
            {
                account = account
            });

            return(r);
        }
Exemplo n.º 8
0
        public async Task <LoginUserResponse> LoginAsync(string account, string passWord)
        {
            BaseServiceRequest <LoginUserResponse> baseService = new BaseServiceRequest <LoginUserResponse>();
            var r = await baseService.GetRequest(new UserLoginRequest()
            {
                account = account, passWord = passWord
            });

            return(r);
        }
Exemplo n.º 9
0
        public async Task <GetUserResponse> GetUsersAsync(UserParameters parameters)
        {
            BaseServiceRequest <GetUserResponse> baseService = new BaseServiceRequest <GetUserResponse>();
            var r = await baseService.GetRequest(new UserQueryRequest()
            {
                parameters = parameters
            });

            return(r);
        }
Exemplo n.º 10
0
        public async Task <bool> DeleteUserAsync(int id)
        {
            BaseServiceRequest <UserResponse> baseService = new BaseServiceRequest <UserResponse>();
            var r = await baseService.GetRequest(new UserDeleteRequest()
            {
                id = id
            }, Method.DELETE);

            return(r.success);
        }
 public ConstructorTests()
 {
     fakeBaseServiceRequest = A.Fake <BaseServiceRequest <FakeEntity> >();
 }