public void Validate(IGetMutedUsersParameters parameters) { if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } }
public Task <ITwitterResult <IUserCursorQueryResultDTO> > GetMutedUsers(IGetMutedUsersParameters parameters, ITwitterRequest request) { var query = _userQueryGenerator.GetMutedUsersQuery(parameters); request.Query.Url = query; request.Query.HttpMethod = HttpMethod.GET; return(_twitterAccessor.ExecuteRequest <IUserCursorQueryResultDTO>(request)); }
public ITwitterIterator <IUser> GetMutedUsersIterator(IGetMutedUsersParameters parameters) { var iterator = _usersRequester.GetMutedUsersIterator(parameters); return(new TwitterIteratorProxy <ITwitterResult <IUserCursorQueryResultDTO>, IUser>(iterator, pageResult => { var userDTOs = pageResult.DataTransferObject.Users; return _client.Factories.CreateUsers(userDTOs); })); }
public GetMutedUsersParameters(IGetMutedUsersParameters source) : base(source) { if (source == null) { PageSize = TwitterLimits.DEFAULTS.ACCOUNT_GET_MUTED_USERS_MAX_PAGE_SIZE; return; } PageSize = source.PageSize; }
public void Validate(IGetMutedUsersParameters parameters) { _usersClientRequiredParametersValidator.Validate(parameters); var maxPageSize = Limits.ACCOUNT_GET_MUTED_USERS_MAX_PAGE_SIZE; if (parameters.PageSize > maxPageSize) { throw new TwitterArgumentLimitException($"{nameof(parameters)}.{nameof(parameters.PageSize)}", maxPageSize, nameof(Limits.ACCOUNT_GET_MUTED_USERS_MAX_PAGE_SIZE), "users"); } }
public string GetMutedUsersQuery(IGetMutedUsersParameters parameters) { var query = new StringBuilder(Resources.Account_Mute_GetUsers); _queryParameterGenerator.AppendCursorParameters(query, parameters); query.AddParameterToQuery("include_entities", parameters.IncludeEntities); query.AddParameterToQuery("skip_status", parameters.SkipStatus); query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters); return(query.ToString()); }
public void Validate(IGetMutedUsersParameters parameters) { _usersClientParametersValidator.Validate(parameters); }
public async Task <IUser[]> GetMutedUsers(IGetMutedUsersParameters parameters) { var iterator = GetMutedUsersIterator(parameters); return((await iterator.NextPage().ConfigureAwait(false)).ToArray()); }
public ITwitterPageIterator <ITwitterResult <IUserCursorQueryResultDTO> > GetMutedUsersIterator(IGetMutedUsersParameters parameters) { _validator.Validate(parameters); var request = TwitterClient.CreateRequest(); request.ExecutionContext.Converters = JsonQueryConverterRepository.Converters; return(_userController.GetMutedUsersIterator(parameters, request)); }
public ITwitterPageIterator <ITwitterResult <IUserCursorQueryResultDTO> > GetMutedUsersIterator(IGetMutedUsersParameters parameters, ITwitterRequest request) { var twitterCursorResult = new TwitterPageIterator <ITwitterResult <IUserCursorQueryResultDTO> >( parameters.Cursor, cursor => { var cursoredParameters = new GetMutedUsersParameters(parameters) { Cursor = cursor }; return(_userQueryExecutor.GetMutedUsers(cursoredParameters, new TwitterRequest(request))); }, page => page.DataTransferObject.NextCursorStr, page => page.DataTransferObject.NextCursorStr == "0"); return(twitterCursorResult); }