Example #1
0
        public ITwitterIterator <ITweet, long?> GetMentionsTimelineIterator(IGetMentionsTimelineParameters parameters)
        {
            var pageIterator = _timelinesRequester.GetMentionsTimelineIterator(parameters);

            return(new TwitterIteratorProxy <ITwitterResult <ITweetDTO[]>, ITweet, long?>(pageIterator,
                                                                                          twitterResult => _client.Factories.CreateTweets(twitterResult?.DataTransferObject)));
        }
Example #2
0
 public void Validate(IGetMentionsTimelineParameters parameters)
 {
     if (parameters == null)
     {
         throw new ArgumentNullException(nameof(parameters));
     }
 }
 public GetMentionsTimelineParameters(IGetMentionsTimelineParameters source) : base(source)
 {
     if (source == null)
     {
         PageSize = TwitterLimits.DEFAULTS.TIMELINE_MENTIONS_PAGE_MAX_PAGE_SIZE;
     }
 }
Example #4
0
        // Mention Timeline
        public Task <ITwitterResult <ITweetDTO[]> > GetMentionsTimelineAsync(IGetMentionsTimelineParameters parameters, ITwitterRequest request)
        {
            var query = _timelineQueryGenerator.GetMentionsTimelineQuery(parameters, request.ExecutionContext.TweetMode);

            request.Query.Url        = query;
            request.Query.HttpMethod = HttpMethod.GET;
            return(_twitterAccessor.ExecuteRequestAsync <ITweetDTO[]>(request));
        }
Example #5
0
        // Mentions Timeline
        public string GetMentionsTimelineQuery(IGetMentionsTimelineParameters parameters, TweetMode?requestTweetMode)
        {
            var query = new StringBuilder(Resources.Timeline_GetMentionsTimeline);

            _queryParameterGenerator.AddTimelineParameters(query, parameters, requestTweetMode);
            query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);

            return(query.ToString());
        }
        public void Validate(IGetMentionsTimelineParameters parameters)
        {
            _timelineClientRequiredParametersValidator.Validate(parameters);

            var maxPageSize = Limits.TIMELINE_MENTIONS_PAGE_MAX_PAGE_SIZE;

            if (parameters.PageSize > maxPageSize)
            {
                throw new TwitterArgumentLimitException($"{nameof(parameters.PageSize)}", maxPageSize, nameof(Limits.TIMELINE_MENTIONS_PAGE_MAX_PAGE_SIZE), "page size");
            }
        }
Example #7
0
 public void Validate(IGetMentionsTimelineParameters parameters)
 {
     _timelineClientParametersValidator.Validate(parameters);
 }
Example #8
0
        public async Task <ITweet[]> GetMentionsTimeline(IGetMentionsTimelineParameters parameters)
        {
            var iterator = GetMentionsTimelineIterator(parameters);

            return((await iterator.NextPage().ConfigureAwait(false)).ToArray());
        }
Example #9
0
        public ITwitterPageIterator <ITwitterResult <ITweetDTO[]>, long?> GetMentionsTimelineIterator(IGetMentionsTimelineParameters parameters, ITwitterRequest request)
        {
            return(_pageCursorIteratorFactories.Create(parameters, cursor =>
            {
                var cursoredParameters = new GetMentionsTimelineParameters(parameters)
                {
                    MaxId = cursor
                };

                return _timelineQueryExecutor.GetMentionsTimeline(cursoredParameters, new TwitterRequest(request));
            }));
        }
        public ITwitterPageIterator <ITwitterResult <ITweetDTO[]>, long?> GetMentionsTimelineIterator(IGetMentionsTimelineParameters parameters)
        {
            _validator.Validate(parameters);

            var request = TwitterClient.CreateRequest();

            return(_timelineController.GetMentionsTimelineIterator(parameters, request));
        }