예제 #1
0
 /// <summary>
 /// Set badge update for receiver. Works only if receiver's platform is iOS.
 /// </summary>
 /// <param name="badge">Change badge.</param>
 /// <returns>notification content for methods chaining</returns>
 public NotificationContent WithBadge(Badge badge)
 {
     _badge = badge;
     return(this);
 }
예제 #2
0
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("THNotificationTemplate(");
            bool          __first = true;

            if (Id != null && __isset.id)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Id: ");
                __sb.Append(Id);
            }
            if (Name != null && __isset.name)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Name: ");
                __sb.Append(Name);
            }
            if (Description != null && __isset.description)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Description: ");
                __sb.Append(Description);
            }
            if (AppId != null && __isset.appId)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("AppId: ");
                __sb.Append(AppId);
            }
            if (MessageType != null && __isset.messageType)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("MessageType: ");
                __sb.Append(MessageType);
            }
            if (Text != null && __isset.text)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Text: ");
                __sb.Append(Text.ToDebugString());
            }
            if (Title != null && __isset.title)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Title: ");
                __sb.Append(Title.ToDebugString());
            }
            if (Image != null && __isset.image)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Image: ");
                __sb.Append(Image);
            }
            if (Video != null && __isset.video)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Video: ");
                __sb.Append(Video);
            }
            if (__isset.createdAt)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("CreatedAt: ");
                __sb.Append(CreatedAt);
            }
            if (CreateUserId != null && __isset.createUserId)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("CreateUserId: ");
                __sb.Append(CreateUserId);
            }
            if (__isset.createdUserRole)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("CreatedUserRole: ");
                __sb.Append(CreatedUserRole);
            }
            if (Action != null && __isset.action)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Action: ");
                __sb.Append(Action == null ? "<null>" : Action.ToString());
            }
            if (ActionButtons != null && __isset.actionButtons)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ActionButtons: ");
                __sb.Append(ActionButtons.ToDebugString());
            }
            if (__isset.expiryMin)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ExpiryMin: ");
                __sb.Append(ExpiryMin);
            }
            if (Media != null && __isset.media)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Media: ");
                __sb.Append(Media == null ? "<null>" : Media.ToString());
            }
            if (PlatformMedia != null && __isset.platformMedia)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("PlatformMedia: ");
                __sb.Append(PlatformMedia.ToDebugString());
            }
            if (Badge != null && __isset.badge)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Badge: ");
                __sb.Append(Badge == null ? "<null>" : Badge.ToString());
            }
            if (Properties != null && __isset.properties)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Properties: ");
                __sb.Append(Properties == null ? "<null>" : Properties.ToString());
            }
            __sb.Append(")");
            return(__sb.ToString());
        }
예제 #3
0
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("THCustomNotification(");
            bool          __first = true;

            if (UserIds != null && __isset.userIds)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("UserIds: ");
                __sb.Append(UserIds.ToDebugString());
            }
            if (__isset.action)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Action: ");
                __sb.Append(Action);
            }
            if (ActionData != null && __isset.actionData)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ActionData: ");
                __sb.Append(ActionData.ToDebugString());
            }
            if (Text != null && __isset.text)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Text: ");
                __sb.Append(Text);
            }
            if (Title != null && __isset.title)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Title: ");
                __sb.Append(Title);
            }
            if (Image != null && __isset.image)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Image: ");
                __sb.Append(Image);
            }
            if (Video != null && __isset.video)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Video: ");
                __sb.Append(Video);
            }
            if (TemplateName != null && __isset.templateName)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("TemplateName: ");
                __sb.Append(TemplateName);
            }
            if (TemplateData != null && __isset.templateData)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("TemplateData: ");
                __sb.Append(TemplateData.ToDebugString());
            }
            if (NewAction != null && __isset.newAction)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("NewAction: ");
                __sb.Append(NewAction == null ? "<null>" : NewAction.ToString());
            }
            if (ActionButtons != null && __isset.actionButtons)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ActionButtons: ");
                __sb.Append(ActionButtons.ToDebugString());
            }
            if (Media != null && __isset.media)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Media: ");
                __sb.Append(Media == null ? "<null>" : Media.ToString());
            }
            if (PlatformMedia != null && __isset.platformMedia)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("PlatformMedia: ");
                __sb.Append(PlatformMedia.ToDebugString());
            }
            if (Badge != null && __isset.badge)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Badge: ");
                __sb.Append(Badge == null ? "<null>" : Badge.ToString());
            }
            if (__isset.expiration)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Expiration: ");
                __sb.Append(Expiration);
            }
            if (Properties != null && __isset.properties)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Properties: ");
                __sb.Append(Properties == null ? "<null>" : Properties.ToString());
            }
            __sb.Append(")");
            return(__sb.ToString());
        }
예제 #4
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("THNotificationTemplate");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (Id != null && __isset.id)
         {
             field.Name = "id";
             field.Type = TType.String;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Id);
             oprot.WriteFieldEnd();
         }
         if (Name != null && __isset.name)
         {
             field.Name = "name";
             field.Type = TType.String;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Name);
             oprot.WriteFieldEnd();
         }
         if (Description != null && __isset.description)
         {
             field.Name = "description";
             field.Type = TType.String;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Description);
             oprot.WriteFieldEnd();
         }
         if (AppId != null && __isset.appId)
         {
             field.Name = "appId";
             field.Type = TType.String;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(AppId);
             oprot.WriteFieldEnd();
         }
         if (MessageType != null && __isset.messageType)
         {
             field.Name = "messageType";
             field.Type = TType.String;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(MessageType);
             oprot.WriteFieldEnd();
         }
         if (Text != null && __isset.text)
         {
             field.Name = "text";
             field.Type = TType.Map;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.String, TType.String, Text.Count));
                 foreach (string _iter20 in Text.Keys)
                 {
                     oprot.WriteString(_iter20);
                     oprot.WriteString(Text[_iter20]);
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Title != null && __isset.title)
         {
             field.Name = "title";
             field.Type = TType.Map;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.String, TType.String, Title.Count));
                 foreach (string _iter21 in Title.Keys)
                 {
                     oprot.WriteString(_iter21);
                     oprot.WriteString(Title[_iter21]);
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Image != null && __isset.image)
         {
             field.Name = "image";
             field.Type = TType.String;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Image);
             oprot.WriteFieldEnd();
         }
         if (Video != null && __isset.video)
         {
             field.Name = "video";
             field.Type = TType.String;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Video);
             oprot.WriteFieldEnd();
         }
         if (__isset.createdAt)
         {
             field.Name = "createdAt";
             field.Type = TType.I32;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32(CreatedAt);
             oprot.WriteFieldEnd();
         }
         if (CreateUserId != null && __isset.createUserId)
         {
             field.Name = "createUserId";
             field.Type = TType.String;
             field.ID   = 11;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(CreateUserId);
             oprot.WriteFieldEnd();
         }
         if (__isset.createdUserRole)
         {
             field.Name = "createdUserRole";
             field.Type = TType.I32;
             field.ID   = 12;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32(CreatedUserRole);
             oprot.WriteFieldEnd();
         }
         if (Action != null && __isset.action)
         {
             field.Name = "action";
             field.Type = TType.Struct;
             field.ID   = 13;
             oprot.WriteFieldBegin(field);
             Action.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ActionButtons != null && __isset.actionButtons)
         {
             field.Name = "actionButtons";
             field.Type = TType.List;
             field.ID   = 14;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, ActionButtons.Count));
                 foreach (THActionButtonLocalized _iter22 in ActionButtons)
                 {
                     _iter22.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (__isset.expiryMin)
         {
             field.Name = "expiryMin";
             field.Type = TType.I32;
             field.ID   = 15;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32(ExpiryMin);
             oprot.WriteFieldEnd();
         }
         if (Media != null && __isset.media)
         {
             field.Name = "media";
             field.Type = TType.Struct;
             field.ID   = 17;
             oprot.WriteFieldBegin(field);
             Media.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (PlatformMedia != null && __isset.platformMedia)
         {
             field.Name = "platformMedia";
             field.Type = TType.Map;
             field.ID   = 18;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.I32, TType.Struct, PlatformMedia.Count));
                 foreach (THDeviceOs _iter23 in PlatformMedia.Keys)
                 {
                     oprot.WriteI32((int)_iter23);
                     PlatformMedia[_iter23].Write(oprot);
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Badge != null && __isset.badge)
         {
             field.Name = "badge";
             field.Type = TType.Struct;
             field.ID   = 19;
             oprot.WriteFieldBegin(field);
             Badge.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Properties != null && __isset.properties)
         {
             field.Name = "properties";
             field.Type = TType.Struct;
             field.ID   = 20;
             oprot.WriteFieldBegin(field);
             Properties.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
예제 #5
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("THCustomNotification");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (UserIds != null && __isset.userIds)
         {
             field.Name = "userIds";
             field.Type = TType.List;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.String, UserIds.Count));
                 foreach (string _iter51 in UserIds)
                 {
                     oprot.WriteString(_iter51);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (__isset.action)
         {
             field.Name = "action";
             field.Type = TType.I32;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32(Action);
             oprot.WriteFieldEnd();
         }
         if (ActionData != null && __isset.actionData)
         {
             field.Name = "actionData";
             field.Type = TType.Map;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.String, TType.String, ActionData.Count));
                 foreach (string _iter52 in ActionData.Keys)
                 {
                     oprot.WriteString(_iter52);
                     oprot.WriteString(ActionData[_iter52]);
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Text != null && __isset.text)
         {
             field.Name = "text";
             field.Type = TType.String;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Text);
             oprot.WriteFieldEnd();
         }
         if (Title != null && __isset.title)
         {
             field.Name = "title";
             field.Type = TType.String;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Title);
             oprot.WriteFieldEnd();
         }
         if (Image != null && __isset.image)
         {
             field.Name = "image";
             field.Type = TType.String;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Image);
             oprot.WriteFieldEnd();
         }
         if (Video != null && __isset.video)
         {
             field.Name = "video";
             field.Type = TType.String;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Video);
             oprot.WriteFieldEnd();
         }
         if (TemplateName != null && __isset.templateName)
         {
             field.Name = "templateName";
             field.Type = TType.String;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(TemplateName);
             oprot.WriteFieldEnd();
         }
         if (TemplateData != null && __isset.templateData)
         {
             field.Name = "templateData";
             field.Type = TType.Map;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.String, TType.String, TemplateData.Count));
                 foreach (string _iter53 in TemplateData.Keys)
                 {
                     oprot.WriteString(_iter53);
                     oprot.WriteString(TemplateData[_iter53]);
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (NewAction != null && __isset.newAction)
         {
             field.Name = "newAction";
             field.Type = TType.Struct;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             NewAction.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ActionButtons != null && __isset.actionButtons)
         {
             field.Name = "actionButtons";
             field.Type = TType.List;
             field.ID   = 11;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, ActionButtons.Count));
                 foreach (THActionButton _iter54 in ActionButtons)
                 {
                     _iter54.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Media != null && __isset.media)
         {
             field.Name = "media";
             field.Type = TType.Struct;
             field.ID   = 12;
             oprot.WriteFieldBegin(field);
             Media.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (PlatformMedia != null && __isset.platformMedia)
         {
             field.Name = "platformMedia";
             field.Type = TType.Map;
             field.ID   = 13;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.I32, TType.Struct, PlatformMedia.Count));
                 foreach (THDeviceOs _iter55 in PlatformMedia.Keys)
                 {
                     oprot.WriteI32((int)_iter55);
                     PlatformMedia[_iter55].Write(oprot);
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Badge != null && __isset.badge)
         {
             field.Name = "badge";
             field.Type = TType.Struct;
             field.ID   = 14;
             oprot.WriteFieldBegin(field);
             Badge.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (__isset.expiration)
         {
             field.Name = "expiration";
             field.Type = TType.I32;
             field.ID   = 15;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32(Expiration);
             oprot.WriteFieldEnd();
         }
         if (Properties != null && __isset.properties)
         {
             field.Name = "properties";
             field.Type = TType.Struct;
             field.ID   = 16;
             oprot.WriteFieldBegin(field);
             Properties.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }