// BLOCK public Task <ITwitterResult <IUserDTO> > BlockUser(IBlockUserParameters parameters, ITwitterRequest request) { var query = _userQueryGenerator.GetBlockUserQuery(parameters); request.Query.Url = query; request.Query.HttpMethod = HttpMethod.POST; return(_twitterAccessor.ExecuteRequest <IUserDTO>(request)); }
public void Validate(IBlockUserParameters parameters) { if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } _userQueryValidator.ThrowIfUserCannotBeIdentified(parameters.User, $"{nameof(parameters.User)}"); }
// BLOCK public string GetBlockUserQuery(IBlockUserParameters parameters) { var query = new StringBuilder(Resources.User_Block_Create); query.AddFormattedParameterToQuery(_userQueryParameterGenerator.GenerateIdOrScreenNameParameter(parameters.User)); query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters); return(query.ToString()); }
public void Validate(IBlockUserParameters parameters) { _usersClientParametersValidator.Validate(parameters); }
public async Task <IUser> BlockUser(IBlockUserParameters parameters) { var twitterResult = await _usersRequester.BlockUser(parameters).ConfigureAwait(false); return(_client.Factories.CreateUser(twitterResult?.DataTransferObject)); }
// BLOCK public Task <ITwitterResult <IUserDTO> > BlockUser(IBlockUserParameters parameters) { _validator.Validate(parameters); return(ExecuteRequest(request => _userController.BlockUser(parameters, request))); }
// BLOCK public Task <ITwitterResult <IUserDTO> > BlockUser(IBlockUserParameters parameters, ITwitterRequest request) { return(_userQueryExecutor.BlockUser(parameters, request)); }
public BlockUserParameters(IBlockUserParameters source) : base(source) { User = source?.User; }