public ActivityPost ParseFromJson(Dictionary <string, object> json) { Id = (string)json["Id"]; Text = json["Text"] as string; ImageUrl = json["ImageUrl"] as string; ButtonTitle = json["ButtonTitle"] as string; #pragma warning disable 0618 ButtonAction = json["ButtonAction"] as string; #pragma warning restore 0618 var action = json["Action"] as Dictionary <string, object>; if (action != null) { Action = new GetSocialAction().ParseFromJson(action); } CreatedAt = DateUtils.FromUnixTime((long)json["CreatedAt"]); var authorDic = json["Author"] as Dictionary <string, object>; Author = new PostAuthor().ParseFromJson(authorDic); CommentsCount = (int)(long)json["CommentsCount"]; LikesCount = (int)(long)json["LikesCount"]; IsLikedByMe = (bool)json["IsLikedByMe"]; StickyStart = DateUtils.FromUnixTime((long)json["StickyStart"]); StickyEnd = DateUtils.FromUnixTime((long)json["StickyEnd"]); Mentions = GSJsonUtils.ParseList <Mention>(json["Mentions"] as string); FeedId = json["FeedId"] as string; return(this); }
public ActivityPost ParseFromAJO(AndroidJavaObject ajo) { using (ajo) { Id = ajo.CallStr("getId"); Text = ajo.CallStr("getText"); ImageUrl = ajo.CallStr("getImageUrl"); ButtonTitle = ajo.CallStr("getButtonTitle"); #pragma warning disable 0618 ButtonAction = ajo.CallStr("getButtonAction"); #pragma warning restore 0618 var action = ajo.CallAJO("getAction"); if (action != null) { Action = new GetSocialAction().ParseFromAJO(action); } CreatedAt = DateUtils.FromUnixTime(ajo.CallLong("getCreatedAt")); Author = new PostAuthor().ParseFromAJO(ajo.CallAJO("getAuthor")); CommentsCount = ajo.CallInt("getCommentsCount"); LikesCount = ajo.CallInt("getLikesCount"); IsLikedByMe = ajo.CallBool("isLikedByMe"); StickyStart = DateUtils.FromUnixTime(ajo.CallLong("getStickyStart")); StickyEnd = DateUtils.FromUnixTime(ajo.CallLong("getStickyEnd")); FeedId = ajo.CallStr("getFeedId"); Mentions = ajo.CallAJO("getMentions").FromJavaList().ConvertAll(mentionAjo => { using (mentionAjo) { return(new Mention().ParseFromAJO(mentionAjo)); } }).ToList(); } return(this); }
/// <summary> /// Create a new button. /// </summary> /// <param name="title">Title of the button.</param> /// <param name="action">Action to be performed when the button is clicked.</param> /// <returns>New button.</returns> public static ActivityButton Create(string title, GetSocialAction action) { return(new ActivityButton { Action = action, Title = title }); }
public static THAction ToRpcModel(this GetSocialAction thAction) { return(thAction == null ? null : new THAction { Type = thAction.Type, Data = thAction.Data }); }
#pragma warning disable 0618 internal Notification(string id, GetSocialAction notificationAction, Type action, string status, string notificationType, long createdAt, string title, string text, string imageUrl, string videoUrl, UserReference sender, List <ActionButton> actionButtons, NotificationCustomization customization) { #pragma warning restore 0618 this.Id = id; this.NotificationAction = notificationAction; #pragma warning disable 0618 this.Action = action; #pragma warning restore 0618 this.ActionButtons = actionButtons; this.Status = status; this.NotificationType = notificationType; this.CreatedAt = createdAt; this.Title = title; this.Text = text; this.ImageUrl = imageUrl; this.VideoUrl = videoUrl; this.Sender = sender; this.Customization = customization; }
internal ActivityPost(string id, string text, string imageUrl, DateTime createdAt, string buttonTitle, string buttonAction, GetSocialAction action, PostAuthor author, int commentsCount, int likesCount, bool isLikedByMe, DateTime stickyStart, DateTime stickyEnd, List <Mention> mentions, string feedId) { Id = id; Text = text; ImageUrl = imageUrl; CreatedAt = createdAt; ButtonTitle = buttonTitle; #pragma warning disable 0618 ButtonAction = buttonAction; #pragma warning restore 0618 Action = action; Author = author; CommentsCount = commentsCount; LikesCount = likesCount; IsLikedByMe = isLikedByMe; StickyStart = stickyStart; StickyEnd = stickyEnd; Mentions = mentions; FeedId = feedId; }
public Notification ParseFromJson(Dictionary <string, object> dictionary) { Title = dictionary["Title"] as string; Id = dictionary["Id"] as string; Status = dictionary["Status"] as string; CreatedAt = (long)dictionary["CreatedAt"]; Text = dictionary["Text"] as string; ImageUrl = dictionary["ImageUrl"] as string; VideoUrl = dictionary["VideoUrl"] as string; NotificationAction = new GetSocialAction().ParseFromJson(dictionary["Action"] as Dictionary <string, object>); ActionButtons = ((List <object>)dictionary["ActionButtons"]).ConvertAll(item => new ActionButton().ParseFromJson((Dictionary <string, object>)item)); NotificationType = dictionary["Type"] as string; #pragma warning disable 618 Action = (Type)(long)dictionary["OldAction"]; #pragma warning restore 618 Sender = new UserReference().ParseFromJson(dictionary["Sender"] as Dictionary <string, object>); Customization = new NotificationCustomization().ParseFromJson(dictionary["Customization"] as Dictionary <string, object>); return(this); }
public Notification ParseFromAJO(AndroidJavaObject ajo) { Id = ajo.CallStr("getId"); Status = ajo.CallStr("getStatus"); NotificationType = ajo.CallStr("getType"); #pragma warning disable 618 Action = (Type)ajo.CallInt("getActionType"); #pragma warning restore 618 CreatedAt = ajo.CallLong("getCreatedAt"); Title = ajo.CallStr("getTitle"); Text = ajo.CallStr("getText"); NotificationAction = new GetSocialAction().ParseFromAJO(ajo.CallAJO("getAction")); ActionButtons = ajo.CallAJO("getActionButtons").FromJavaList().ConvertAll(item => { using (item) { return(new ActionButton().ParseFromAJO(item)); } }); ImageUrl = ajo.CallStr("getImageUrl"); VideoUrl = ajo.CallStr("getVideoUrl"); Sender = new UserReference().ParseFromAJO(ajo.CallAJO("getSender")); Customization = new NotificationCustomization().ParseFromAJO(ajo.CallAJO("getCustomization")); return(this); }
public static GetSocialAction FromRpcModel(this THAction thAction) { return(GetSocialAction.Create(thAction.Type, thAction.Data ?? new Dictionary <string, string>())); }
public NotificationContent WithAction(GetSocialAction action) { _action = action; return(this); }
public void Handle(GetSocialAction action) { CallSync <string>("GetSocial.handleAction", GSJson.Serialize(action)); }
public void ProcessAction(GetSocialAction notificationAction) { _getSocial.CallStatic("processAction", notificationAction.ToAjo()); }
public void ProcessAction(GetSocialAction notificationAction) { _gs_processAction(notificationAction.ToJson()); }
public static GetSocialAction FromRpcModel(this THAction thAction) { return(thAction == null ? null : GetSocialAction.CreateBuilder(thAction.Type) .AddActionData(thAction.Data) .Build()); }
/// <summary> /// Process action by GetSocial SDK. /// </summary> /// <param name="action">Action to be processed</param> public static void Handle(GetSocialAction action) { GetSocialFactory.Bridge.Handle(action); }
public void ProcessAction(GetSocialAction notificationAction) { GetSocialLogs.W("ProcessAction is not supported in Editor yet"); }
public void ProcessAction(GetSocialAction notificationAction) { DebugUtils.LogMethodCall(MethodBase.GetCurrentMethod(), notificationAction); }
public Builder WithButton(string title, GetSocialAction action) { _content._buttonTitle = title; _content._action = action; return(this); }