Exemple #1
0
        private async Task <RestResponse> SendImpressionInternalAsync(Impression impression, RequestOptions options)
        {
            if (impression == null)
            {
                throw new ArgumentNullException(nameof(impression), "The provided impression can't be null!");
            }

            return(await SendInternalAsync("POST", GfycatAnalyticsClientConfig.BaseImpressionsUrl + impression.CreateQuery(this), options));
        }
Exemple #2
0
 internal static string CreateQuery(this Impression impression, GfycatAnalyticsClient client)
 {
     return(Utils.CreateQueryString(
                ("app_id", client.Config.AppId),
                ("ver", client.Config.AppVersion),
                ("utc", client.CurrentUserTrackingCookie),
                ("stc", client.Config.SessionId),
                ("gfyid", impression.Gfycat.Id),
                ("context", impression.Context == ImpressionContext.None ? null : impression.Context.ToString()),
                ("keyword", impression.Keyword),
                ("flow", impression.Flow == ImpressionFlow.None ? null : impression.Flow.ToString()),
                ("viewtag", impression.ViewTag)));
 }
Exemple #3
0
 /// <summary>
 /// Sends one impression to Gfycat impressions
 /// </summary>
 /// <param name="impression"></param>
 /// <param name="options">The options for this request</param>
 /// <returns></returns>
 public async Task SendImpressionAsync(Impression impression, RequestOptions options = null)
 {
     await SendImpressionInternalAsync(impression, options);
 }
Exemple #4
0
        internal static string CreateQuery(this IEnumerable <Impression> impressions, GfycatAnalyticsClient client)
        {
            Impression impression = impressions.FirstOrDefault();

            IEnumerable <(string, object)> queryStringEnumerable = new (string, object)[] {