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)); }
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))); }
/// <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); }
internal static string CreateQuery(this IEnumerable <Impression> impressions, GfycatAnalyticsClient client) { Impression impression = impressions.FirstOrDefault(); IEnumerable <(string, object)> queryStringEnumerable = new (string, object)[] {