public GetMembersOfListParameters(IGetMembersOfListParameters parameters) : base(parameters)
 {
     if (parameters == null)
     {
         PageSize = TwitterLimits.DEFAULTS.LISTS_GET_MEMBERS_MAX_PAGE_SIZE;
     }
 }
Example #2
0
        public ITwitterIterator <IUser> GetMembersOfListIterator(IGetMembersOfListParameters parameters)
        {
            var iterator = _twitterListsRequester.GetMembersOfListIterator(parameters);

            return(new TwitterIteratorProxy <ITwitterResult <IUserCursorQueryResultDTO>, IUser>(iterator, pageResult =>
            {
                return _client.Factories.CreateUsers(pageResult?.Model?.Users);
            }));
        }
        public void Validate(IGetMembersOfListParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            ThrowIfListIdentifierIsNotValid(parameters.List);
        }
Example #4
0
        public void Validate(IGetMembersOfListParameters parameters)
        {
            _twitterListsClientRequiredParametersValidator.Validate(parameters);

            var maxPageSize = Limits.LISTS_GET_MEMBERS_MAX_PAGE_SIZE;

            if (parameters.PageSize > maxPageSize)
            {
                throw new TwitterArgumentLimitException($"{nameof(parameters)}.{nameof(parameters.PageSize)}", maxPageSize, nameof(Limits.LISTS_GET_MEMBERS_MAX_PAGE_SIZE), "page size");
            }
        }
Example #5
0
        public string GetMembersOfListQuery(IGetMembersOfListParameters parameters)
        {
            var query = new StringBuilder(Resources.List_Members_List);

            _twitterListQueryParameterGenerator.AppendListIdentifierParameter(query, parameters.List);
            _queryParameterGenerator.AppendCursorParameters(query, parameters);

            query.AddParameterToQuery("include_entities", parameters.IncludeEntities);
            query.AddParameterToQuery("skip_status", parameters.SkipStatus);

            query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);

            return(query.ToString());
        }
Example #6
0
 public void Validate(IGetMembersOfListParameters parameters)
 {
     _twitterListsClientParametersValidator.Validate(parameters);
 }
Example #7
0
 public Task <ITwitterResult <IUserCursorQueryResultDTO> > GetMembersOfListAsync(IGetMembersOfListParameters parameters, ITwitterRequest request)
 {
     request.Query.Url        = _listsQueryGenerator.GetMembersOfListQuery(parameters);
     request.Query.HttpMethod = HttpMethod.GET;
     return(_twitterAccessor.ExecuteRequestAsync <IUserCursorQueryResultDTO>(request));
 }
Example #8
0
        public async Task <IUser[]> GetMembersOfListAsync(IGetMembersOfListParameters parameters)
        {
            var iterator = GetMembersOfListIterator(parameters);

            return((await iterator.NextPageAsync().ConfigureAwait(false)).ToArray());
        }
Example #9
0
        public ITwitterPageIterator <ITwitterResult <IUserCursorQueryResultDTO> > GetMembersOfListIterator(IGetMembersOfListParameters parameters)
        {
            _validator.Validate(parameters);

            var request = TwitterClient.CreateRequest();

            request.ExecutionContext.Converters = JsonQueryConverterRepository.Converters;
            return(_twitterListController.GetMembersOfListIterator(parameters, request));
        }
        public ITwitterPageIterator <ITwitterResult <IUserCursorQueryResultDTO> > GetMembersOfListIterator(IGetMembersOfListParameters parameters, ITwitterRequest request)
        {
            return(_pageCursorIteratorFactories.Create(parameters, cursor =>
            {
                var cursoredParameters = new GetMembersOfListParameters(parameters)
                {
                    Cursor = cursor
                };

                return _twitterListQueryExecutor.GetMembersOfListAsync(cursoredParameters, new TwitterRequest(request));
            }));
        }