// FOLLOWERS public Task <ITwitterResult <IUserDTO> > FollowUser(IFollowUserParameters parameters, ITwitterRequest request) { var query = _userQueryGenerator.GetFollowUserQuery(parameters); request.Query.Url = query; request.Query.HttpMethod = HttpMethod.POST; return(_twitterAccessor.ExecuteRequest <IUserDTO>(request)); }
public void Validate(IFollowUserParameters parameters) { if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } _userQueryValidator.ThrowIfUserCannotBeIdentified(parameters.User, $"{nameof(parameters.User)}"); }
// FOLLOWERS public string GetFollowUserQuery(IFollowUserParameters parameters) { var query = new StringBuilder(Resources.Friendship_Create); query.AddFormattedParameterToQuery(_userQueryParameterGenerator.GenerateIdOrScreenNameParameter(parameters.User)); query.AddParameterToQuery("follow", parameters.EnableNotifications); query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters); return(query.ToString()); }
public void Validate(IFollowUserParameters parameters) { _usersClientParametersValidator.Validate(parameters); }
public async Task <IUser> FollowUser(IFollowUserParameters parameters) { var twitterResult = await _usersRequester.FollowUser(parameters).ConfigureAwait(false); return(_client.Factories.CreateUser(twitterResult?.DataTransferObject)); }
// FOLLOWERS public Task <ITwitterResult <IUserDTO> > FollowUser(IFollowUserParameters parameters) { _validator.Validate(parameters); return(ExecuteRequest(request => _userController.FollowUser(parameters, request))); }
// FOLLOW/UNFOLLOW public Task <ITwitterResult <IUserDTO> > FollowUser(IFollowUserParameters parameters, ITwitterRequest request) { return(_userQueryExecutor.FollowUser(parameters, request)); }
public FollowUserParameters(IFollowUserParameters parameters) : base(parameters) { User = parameters?.User; EnableNotifications = parameters?.EnableNotifications; }