/// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        public IHttpQueryString GetQueryString()
        {
            if (AppId == 0)
            {
                throw new PropertyNotSetException(nameof(AppId));
            }

            IHttpQueryString qs = new SocialHttpQueryString();

            qs.Set("appid", AppId);
            if (MaxLength > 0)
            {
                qs.Set("maxlength", MaxLength);
            }
            if (EndDate != null)
            {
                qs.Set("enddate", EndDate);
            }
            if (Count > 0)
            {
                qs.Set("count", Count);
            }
            if (Feeds != null && Feeds.Length > 0)
            {
                qs.Set("feeds", String.Join(",", Feeds));
            }

            return(qs);
        }
Exemple #2
0
        /// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        /// <returns>An instance of <see cref="IHttpQueryString"/>.</returns>
        public IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString qs = new SocialHttpQueryString();

            if (UserId > 0)
            {
                qs.Set("user_id", UserId);
            }
            if (!String.IsNullOrWhiteSpace(ScreenName))
            {
                qs.Set("screen_name", ScreenName);
            }
            if (Count > 0)
            {
                qs.Set("count", Count);
            }
            if (Cursor > 0)
            {
                qs.Set("cursor", Cursor);
            }
            if (FilterToOwnedLists)
            {
                qs.Set("filter_to_owned_lists", "1");
            }
            return(qs);
        }
        /// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        /// <returns>An instance of <see cref="IHttpQueryString"/>.</returns>
        public IHttpQueryString GetQueryString()
        {
            // Since the name is mandatory, we throw an exception if no specified
            if (String.IsNullOrWhiteSpace(Name))
            {
                throw new PropertyNotSetException("Name");
            }

            // Convert the collection of fields to a string
            string fields = (Fields == null ? "" : Fields.ToString()).Trim();

            // Construct the query string
            SocialHttpQueryString query = new SocialHttpQueryString();

            query.Set("name", Name);
            if (!String.IsNullOrWhiteSpace(Description))
            {
                query.Add("description", Description);
            }
            if (!String.IsNullOrWhiteSpace(fields))
            {
                query.Set("fields", fields);
            }

            return(query);
        }
Exemple #4
0
        public IHttpQueryString GetQueryString()
        {
            // Initialize the query string
            SocialHttpQueryString query = new SocialHttpQueryString();

            // Set required parameters
            query.Set("lat", Latitude);
            query.Set("long", Longitude);

            // Set optional parameters
            if (Accurary != null && Accurary != "0m")
            {
                query.Set("accuracy", Accurary);
            }
            if (Granularity != default(TwitterGranularity))
            {
                query.Set("granularity", Granularity.ToString().ToLower());
            }
            if (MaxResults > 0)
            {
                query.Set("max_results", MaxResults);
            }

            return(query);
        }
Exemple #5
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("steamid", SteamId);
            qs.Set("relationship", Relationship);
            return(qs);
        }
Exemple #6
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("itemcount", ItemCount);
            qs.Set("publishedfields[0]", PublishedFields);
            return(qs);
        }
Exemple #7
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("steamid", SteamId);
            qs.Set("appid_playing", AppIdPlaying);
            return(qs);
        }
Exemple #8
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("collectioncount", CollectionCount);
            qs.Set("publishedfields[0]", PublishedFields);
            return(qs);
        }
Exemple #9
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("appid", AppId);
            qs.Set("version", Version);
            return(qs);
        }
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("steamid", SteamId);
            qs.Set("include_appinfo", IncludeAppInfo);
            qs.Set("include_played_free_games", IncludePlayedFreeGames);
            qs.Set("appids_filter", AppIdsFilter);
            return(qs);
        }
Exemple #11
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("appid", AppId);
            if (!string.IsNullOrWhiteSpace(Lang))
            {
                qs.Set("l", Lang);
            }
            return(qs);
        }
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("cellid", CellId);
            if (MaxCount != null)
            {
                qs.Set("maxcount", MaxCount);
            }
            return(qs);
        }
Exemple #13
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("steamid", SteamId);
            if (Count != null)
            {
                qs.Set("count", Count);
            }
            return(qs);
        }
Exemple #14
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("leaderboardName", LeaderboardName);
            return(qs);
        }
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("steamids", SteamIds);
            return(qs);
        }
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("addr", Addr);
            return(qs);
        }
Exemple #17
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("access_token", AccessToken);
            return(qs);
        }
Exemple #18
0
        /// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        /// <returns>An instance of <see cref="IHttpQueryString"/>.</returns>
        public IHttpQueryString GetQueryString()
        {
            if (Id == 0)
            {
                throw new PropertyNotSetException(nameof(Id));
            }

            SocialHttpQueryString query = new SocialHttpQueryString();

            query.Set("id", Id);
            if (TrimUser)
            {
                query.Add("trim_user", "true");
            }
            if (IncludeMyRetweet)
            {
                query.Add("include_my_retweet", "true");
            }
            if (IncludeEntities)
            {
                query.Add("include_entities", "true");
            }
            if (TweetMode != TwitterTweetMode.Compatibility)
            {
                query.Add("tweet_mode", StringUtils.ToCamelCase(TweetMode));
            }
            return(query);
        }
Exemple #19
0
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("gameid", GameId);
            return(qs);
        }
        public IHttpQueryString GetQueryString()
        {
            var qs = new SocialHttpQueryString();

            qs.Set("appid", AppId);
            qs.Set("count", Count);
            qs.Set("name[0]", Name);
            if (StartDate != null)
            {
                qs.Set("startdate", StartDate);
            }
            if (EndDate != null)
            {
                qs.Set("enddate", EndDate);
            }
            return(qs);
        }
        /// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        /// <returns>An instance of <see cref="IHttpQueryString"/>.</returns>
        public IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString qs = new SocialHttpQueryString();

            if (UserId > 0)
            {
                qs.Set("user_id", UserId);
            }
            if (!String.IsNullOrWhiteSpace(ScreenName))
            {
                qs.Set("screen_name", ScreenName);
            }
            if (Reverse)
            {
                qs.Set("reverse", "1");
            }
            return(qs);
        }
Exemple #22
0
        /// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        public virtual IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString query = new SocialHttpQueryString();

            if (Limit != null && Limit.Value >= 0)
            {
                query.Set("limit", Limit.Value);
            }
            if (Before != null)
            {
                query.Set("before", Before);
            }
            if (After != null)
            {
                query.Set("after", After);
            }
            return(query);
        }
Exemple #23
0
        /// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        public virtual IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString query = new SocialHttpQueryString();

            if (Limit >= 0)
            {
                query.Set("limit", Limit);
            }
            if (Since != null && Since.UnixTimestamp > 0)
            {
                query.Set("since", Since.UnixTimestamp);
            }
            if (Until != null && Until.UnixTimestamp > 0)
            {
                query.Set("until", Until.UnixTimestamp);
            }
            return(query);
        }
Exemple #24
0
        public IHttpQueryString GetQueryString()
        {
            // Define the query string
            SocialHttpQueryString qs = new SocialHttpQueryString();

            // Add optional parameters
            if (UserId > 0)
            {
                qs.Set("user_id", UserId);
            }
            if (!String.IsNullOrWhiteSpace(ScreenName))
            {
                qs.Set("screen_name", ScreenName);
            }
            if (SinceId > 0)
            {
                qs.Set("since_id", SinceId);
            }
            if (Count > 0)
            {
                qs.Set("count", Count);
            }
            if (MaxId > 0)
            {
                qs.Set("max_id", MaxId);
            }
            if (TrimUser)
            {
                qs.Set("trim_user", "true");
            }
            if (ExcludeReplies)
            {
                qs.Set("exclude_replies", "true");
            }
            if (ContributorDetails)
            {
                qs.Set("contributor_details", "true");
            }
            if (!IncludeRetweets)
            {
                qs.Set("include_rts", "false");
            }
            if (TweetMode != TwitterTweetMode.Compatibility)
            {
                qs.Add("tweet_mode", StringUtils.ToCamelCase(TweetMode));
            }

            return(qs);
        }
        public IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString qs = new SocialHttpQueryString();

            qs.Set("q", Query);
            if (Page > 1)
            {
                qs.Set("page", Page);
            }
            if (Count != 20)
            {
                qs.Set("count", Count);
            }
            if (!IncludeEntities)
            {
                qs.Set("include_entities", "false");
            }
            return(qs);
        }
Exemple #26
0
        /// <summary>
        /// Favorites the status message with the specified <paramref name="statusId"/> as the authenticating user.
        /// </summary>
        /// <param name="statusId">The ID of the status message.</param>
        /// <returns>An instance of <see cref="SocialHttpResponse"/> representing the raw response.</returns>
        /// <see>
        ///     <cref>https://dev.twitter.com/rest/reference/post/favorites/create</cref>
        /// </see>
        public SocialHttpResponse Create(long statusId)
        {
            // Declare the query string
            SocialHttpQueryString query = new SocialHttpQueryString();

            query.Set("id", statusId);

            // Make the call to the API
            return(Client.DoHttpGetRequest("https://api.twitter.com/1.1/favorites/create.json", query));
        }
        public IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString qs = new SocialHttpQueryString();

            if (UserId > 0)
            {
                qs.Set("user_id", UserId);
            }
            if (!String.IsNullOrWhiteSpace(ScreenName))
            {
                qs.Set("screen_name", ScreenName);
            }
            if (Count > 0)
            {
                qs.Set("count", Count);
            }
            if (SinceId > 0)
            {
                qs.Set("since_id", SinceId);
            }
            if (MaxId > 0)
            {
                qs.Set("max_id", MaxId);
            }
            if (!IncludeEntities)
            {
                qs.Set("include_entities", "0");
            }
            return(qs);
        }
        /// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        /// <returns>An instance of <see cref="IHttpQueryString"/>.</returns>
        public IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString qs = new SocialHttpQueryString();

            if (UserId > 0)
            {
                qs.Set("user_id", UserId);
            }
            if (!String.IsNullOrWhiteSpace(ScreenName))
            {
                qs.Set("screen_name", ScreenName);
            }
            if (Cursor != DefaultCursor)
            {
                qs.Set("cursor", Cursor);
            }
            if (Count != DefaultCount)
            {
                qs.Set("count", Count);
            }
            if (SkipStatus != DefaultSkipStatus)
            {
                qs.Set("skip_status", SkipStatus ? "1" : "0");
            }
            if (IncludeUserEntities != DefaultIncludeUserEntities)
            {
                qs.Set("include_user_entities", IncludeUserEntities ? "1" : "0");
            }
            return(qs);
        }
        public IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString qs = new SocialHttpQueryString();

            if (UserId > 0)
            {
                qs.Set("user_id", UserId);
            }
            if (!String.IsNullOrWhiteSpace(ScreenName))
            {
                qs.Set("screen_name", ScreenName);
            }
            if (Cursor != DefaultCursor)
            {
                qs.Set("cursor", Cursor);
            }
            if (Count != DefaultCount)
            {
                qs.Set("count", Count);
            }
            return(qs);
        }
        /// <summary>
        /// Gets an instance of <see cref="IHttpQueryString"/> representing the GET parameters.
        /// </summary>
        /// <returns>An instance of <see cref="IHttpQueryString"/>.</returns>
        public IHttpQueryString GetQueryString()
        {
            SocialHttpQueryString qs = new SocialHttpQueryString();

            if (Id > 0)
            {
                qs.Set("list_id", UserId);
            }
            if (!String.IsNullOrWhiteSpace(Slug))
            {
                qs.Set("slug", Slug);
            }
            if (UserId > 0)
            {
                qs.Set("owner_id", UserId);
            }
            if (!String.IsNullOrWhiteSpace(ScreenName))
            {
                qs.Set("owner_screen_name", ScreenName);
            }
            return(qs);
        }