Appboy.Models.Cards.CrossPromotionSmallCard.CrossPromotionSmallCard C# (CSharp) Method

CrossPromotionSmallCard() public method

public CrossPromotionSmallCard ( Appboy.Utilities.JSONClass json ) : System
json Appboy.Utilities.JSONClass
return System
        public CrossPromotionSmallCard(JSONClass json)
            : base(json)
        {
            if (json["title"] == null || json["subtitle"] == null || json["caption"] == null || json["rating"] == null || json["reviews"] == null || json["price"] == null || json["url"] == null) {
            throw new ArgumentException("Missing required field(s).");
              }
              Title = json["title"];
              Subtitle = json["subtitle"];
              Caption = json["caption"];
              ImageUrl = json["image"];
              Rating = json["rating"].AsDouble;
              ReviewCount = json["reviews"].AsInt;
              Price = json["price"].AsDouble;
              Url = json["url"];

            #if UNITY_ANDROID
              if (json["package"] == null) {
            throw new ArgumentException("Missing required field(s).");
              }
              Package = json["package"];
            #endif
            #if UNITY_IOS
              if (json["media_type"] == null || json["itunes_id"] == null) {
            throw new ArgumentException("Missing required field(s).");
              }
              MediaType = json["media_type"];
              ITunesId = json["itunes_id"].AsInt;
              if (json["universal"].AsBool) {
            Universal = json["universal"].AsBool;
              }
            #endif
        }