public string GetTweetsFromListQuery(IGetTweetsFromListQueryParameters getTweetsFromListQueryParameters) { _listsQueryValidator.ThrowIfGetTweetsFromListQueryParametersIsNotValid(getTweetsFromListQueryParameters); var identifier = getTweetsFromListQueryParameters.TwitterListIdentifier; var parameters = getTweetsFromListQueryParameters.Parameters; StringBuilder queryParameters = new StringBuilder(); queryParameters.Append(_twitterListQueryParameterGenerator.GenerateIdentifierParameter(identifier)); if (parameters != null) { queryParameters.Append(_queryParameterGenerator.GenerateSinceIdParameter(parameters.SinceId)); queryParameters.Append(_queryParameterGenerator.GenerateMaxIdParameter(parameters.MaxId)); queryParameters.Append(_queryParameterGenerator.GenerateCountParameter(parameters.MaximumNumberOfTweetsToRetrieve)); queryParameters.Append(_queryParameterGenerator.GenerateIncludeEntitiesParameter(parameters.IncludeEntities)); queryParameters.Append(_queryParameterGenerator.GenerateIncludeRetweetsParameter(parameters.IncludeRetweets)); } else { queryParameters.Append(_queryParameterGenerator.GenerateCountParameter(TweetinviConsts.LIST_GET_TWEETS_COUNT)); } queryParameters.AddFormattedParameterToParametersList(_queryParameterGenerator.GenerateTweetModeParameter(_tweetinviSettingsAccessor.CurrentThreadSettings.TweetMode)); return(string.Format(Resources.List_GetTweetsFromList, queryParameters)); }
// Base Timeline Query Generator private string GenerateTimelineRequestParameter(ITimelineRequestParameters timelineRequestParameters) { var requestParameter = new StringBuilder(); requestParameter.Append(_queryParameterGenerator.GenerateCountParameter(timelineRequestParameters.MaximumNumberOfTweetsToRetrieve)); requestParameter.Append(_queryParameterGenerator.GenerateTrimUserParameter(timelineRequestParameters.TrimUser)); requestParameter.Append(_queryParameterGenerator.GenerateSinceIdParameter(timelineRequestParameters.SinceId)); requestParameter.Append(_queryParameterGenerator.GenerateMaxIdParameter(timelineRequestParameters.MaxId)); requestParameter.Append(_queryParameterGenerator.GenerateIncludeEntitiesParameter(timelineRequestParameters.IncludeEntities)); requestParameter.Append(_queryParameterGenerator.GenerateAdditionalRequestParameters(timelineRequestParameters.FormattedCustomQueryParameters)); requestParameter.AddFormattedParameterToParametersList(_queryParameterGenerator.GenerateTweetModeParameter(_tweetinviSettingsAccessor.CurrentThreadSettings.TweetMode)); return(requestParameter.ToString()); }