/// <summary>
 /// Deserialize the object
 /// </summary>
 public virtual void DeserializeJson(JToken inputObject)
 {
     if (inputObject != null && inputObject.Type != JTokenType.Null)
     {
         JToken catalogImageUriValue = inputObject["catalogImageUri"];
         if (catalogImageUriValue != null && catalogImageUriValue.Type != JTokenType.Null)
         {
             this.CatalogImageUri = ((string)catalogImageUriValue);
         }
         JToken countValue = inputObject["count"];
         if (countValue != null && countValue.Type != JTokenType.Null)
         {
             this.Count = ((int)countValue);
         }
         JToken filtersSequence = ((JToken)inputObject["filters"]);
         if (filtersSequence != null && filtersSequence.Type != JTokenType.Null)
         {
             foreach (JToken filtersValue in ((JArray)filtersSequence))
             {
                 this.Filters.Add(((string)filtersValue));
             }
         }
         JToken mobileCatalogImageUriValue = inputObject["mobileCatalogImageUri"];
         if (mobileCatalogImageUriValue != null && mobileCatalogImageUriValue.Type != JTokenType.Null)
         {
             this.MobileCatalogImageUri = ((string)mobileCatalogImageUriValue);
         }
         JToken paginationValue = inputObject["pagination"];
         if (paginationValue != null && paginationValue.Type != JTokenType.Null)
         {
             Pagination pagination = new Pagination();
             pagination.DeserializeJson(paginationValue);
             this.Pagination = pagination;
         }
         JToken resultsSequence = ((JToken)inputObject["results"]);
         if (resultsSequence != null && resultsSequence.Type != JTokenType.Null)
         {
             foreach (JToken resultsValue in ((JArray)resultsSequence))
             {
                 ProductCatalog productCatalog = new ProductCatalog();
                 productCatalog.DeserializeJson(resultsValue);
                 this.Results.Add(productCatalog);
             }
         }
         JToken seoValue = inputObject["seo"];
         if (seoValue != null && seoValue.Type != JTokenType.Null)
         {
             Seo seo = new Seo();
             seo.DeserializeJson(seoValue);
             this.Seo = seo;
         }
         JToken textSliderValue = inputObject["textSlider"];
         if (textSliderValue != null && textSliderValue.Type != JTokenType.Null)
         {
             TextSlider textSlider = new TextSlider();
             textSlider.DeserializeJson(textSliderValue);
             this.TextSlider = textSlider;
         }
     }
 }
Example #2
0
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public virtual void DeserializeJson(JToken inputObject)
 {
     if (inputObject != null && inputObject.Type != JTokenType.Null)
     {
         JToken countValue = inputObject["count"];
         if (countValue != null && countValue.Type != JTokenType.Null)
         {
             this.Count = ((int)countValue);
         }
         JToken countryCodeValue = inputObject["countryCode"];
         if (countryCodeValue != null && countryCodeValue.Type != JTokenType.Null)
         {
             this.CountryCode = ((string)countryCodeValue);
         }
         JToken countryDescriptionValue = inputObject["countryDescription"];
         if (countryDescriptionValue != null && countryDescriptionValue.Type != JTokenType.Null)
         {
             this.CountryDescription = ((string)countryDescriptionValue);
         }
         JToken paginationValue = inputObject["pagination"];
         if (paginationValue != null && paginationValue.Type != JTokenType.Null)
         {
             Pagination pagination = new Pagination();
             pagination.DeserializeJson(paginationValue);
             this.Pagination = pagination;
         }
         JToken resultsSequence = ((JToken)inputObject["results"]);
         if (resultsSequence != null && resultsSequence.Type != JTokenType.Null)
         {
             foreach (JToken resultsValue in ((JArray)resultsSequence))
             {
                 Retailer retailer = new Retailer();
                 retailer.DeserializeJson(resultsValue);
                 this.Results.Add(retailer);
             }
         }
         JToken seoValue = inputObject["seo"];
         if (seoValue != null && seoValue.Type != JTokenType.Null)
         {
             Seo seo = new Seo();
             seo.DeserializeJson(seoValue);
             this.Seo = seo;
         }
     }
 }
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public virtual void DeserializeJson(JToken inputObject)
 {
     if (inputObject != null && inputObject.Type != JTokenType.Null)
     {
         JToken averageValue = inputObject["average"];
         if (averageValue != null && averageValue.Type != JTokenType.Null)
         {
             this.Average = ((double)averageValue);
         }
         JToken countValue = inputObject["count"];
         if (countValue != null && countValue.Type != JTokenType.Null)
         {
             this.Count = ((int)countValue);
         }
         JToken paginationValue = inputObject["pagination"];
         if (paginationValue != null && paginationValue.Type != JTokenType.Null)
         {
             Pagination pagination = new Pagination();
             pagination.DeserializeJson(paginationValue);
             this.Pagination = pagination;
         }
         JToken resultsSequence = ((JToken)inputObject["results"]);
         if (resultsSequence != null && resultsSequence.Type != JTokenType.Null)
         {
             foreach (JToken resultsValue in ((JArray)resultsSequence))
             {
                 ProductReview productReview = new ProductReview();
                 productReview.DeserializeJson(resultsValue);
                 this.Results.Add(productReview);
             }
         }
         JToken seoValue = inputObject["seo"];
         if (seoValue != null && seoValue.Type != JTokenType.Null)
         {
             Seo seo = new Seo();
             seo.DeserializeJson(seoValue);
             this.Seo = seo;
         }
     }
 }
Example #4
0
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public virtual void DeserializeJson(JToken inputObject)
 {
     if (inputObject != null && inputObject.Type != JTokenType.Null)
     {
         JToken availableSizeValue = inputObject["availableSize"];
         if (availableSizeValue != null && availableSizeValue.Type != JTokenType.Null)
         {
             this.AvailableSize = ((string)availableSizeValue);
         }
         JToken brandValue = inputObject["brand"];
         if (brandValue != null && brandValue.Type != JTokenType.Null)
         {
             this.Brand = ((string)brandValue);
         }
         JToken brandDescriptionValue = inputObject["brandDescription"];
         if (brandDescriptionValue != null && brandDescriptionValue.Type != JTokenType.Null)
         {
             this.BrandDescription = ((string)brandDescriptionValue);
         }
         JToken breadcrumbValue = inputObject["breadcrumb"];
         if (breadcrumbValue != null && breadcrumbValue.Type != JTokenType.Null)
         {
             Breadcrumb breadcrumb = new Breadcrumb();
             breadcrumb.DeserializeJson(breadcrumbValue);
             this.Breadcrumb = breadcrumb;
         }
         JToken enabledValue = inputObject["enabled"];
         if (enabledValue != null && enabledValue.Type != JTokenType.Null)
         {
             this.Enabled = ((bool)enabledValue);
         }
         JToken genderValue = inputObject["gender"];
         if (genderValue != null && genderValue.Type != JTokenType.Null)
         {
             this.Gender = ((string)genderValue);
         }
         JToken fitRiseWaistValue = inputObject["fitRiseWaist"];
         if (fitRiseWaistValue != null && fitRiseWaistValue.Type != JTokenType.Null)
         {
             this.FitRiseWaist = ((string)fitRiseWaistValue);
         }
         JToken imageValue = inputObject["image"];
         if (imageValue != null && imageValue.Type != JTokenType.Null)
         {
             Image image = new Image();
             image.DeserializeJson(imageValue);
             this.Image = image;
         }
         JToken isForGroupValue = inputObject["isForGroup"];
         if (isForGroupValue != null && isForGroupValue.Type != JTokenType.Null)
         {
             this.IsForGroup = ((bool)isForGroupValue);
         }
         JToken isNewValue = inputObject["isNew"];
         if (isNewValue != null && isNewValue.Type != JTokenType.Null)
         {
             this.IsNew = ((bool)isNewValue);
         }
         JToken isPopularValue = inputObject["isPopular"];
         if (isPopularValue != null && isPopularValue.Type != JTokenType.Null)
         {
             this.IsPopular = ((bool)isPopularValue);
         }
         JToken isSolidValue = inputObject["isSolid"];
         if (isSolidValue != null && isSolidValue.Type != JTokenType.Null)
         {
             this.IsSolid = ((bool)isSolidValue);
         }
         JToken materialValue = inputObject["material"];
         if (materialValue != null && materialValue.Type != JTokenType.Null)
         {
             this.Material = ((string)materialValue);
         }
         JToken nextProductValue = inputObject["nextProduct"];
         if (nextProductValue != null && nextProductValue.Type != JTokenType.Null)
         {
             this.NextProduct = ((string)nextProductValue);
         }
         JToken previousProductValue = inputObject["previousProduct"];
         if (previousProductValue != null && previousProductValue.Type != JTokenType.Null)
         {
             this.PreviousProduct = ((string)previousProductValue);
         }
         JToken productCodeValue = inputObject["productCode"];
         if (productCodeValue != null && productCodeValue.Type != JTokenType.Null)
         {
             this.ProductCode = ((string)productCodeValue);
         }
         JToken productDescriptionValue = inputObject["productDescription"];
         if (productDescriptionValue != null && productDescriptionValue.Type != JTokenType.Null)
         {
             this.ProductDescription = ((string)productDescriptionValue);
         }
         JToken productNameValue = inputObject["productName"];
         if (productNameValue != null && productNameValue.Type != JTokenType.Null)
         {
             this.ProductName = ((string)productNameValue);
         }
         JToken productTypeValue = inputObject["productType"];
         if (productTypeValue != null && productTypeValue.Type != JTokenType.Null)
         {
             this.ProductType = ((string)productTypeValue);
         }
         JToken productTypeDescriptionValue = inputObject["productTypeDescription"];
         if (productTypeDescriptionValue != null && productTypeDescriptionValue.Type != JTokenType.Null)
         {
             this.ProductTypeDescription = ((string)productTypeDescriptionValue);
         }
         JToken seoValue = inputObject["seo"];
         if (seoValue != null && seoValue.Type != JTokenType.Null)
         {
             Seo seo = new Seo();
             seo.DeserializeJson(seoValue);
             this.Seo = seo;
         }
         JToken sockCollectionsSequence = ((JToken)inputObject["sockCollections"]);
         if (sockCollectionsSequence != null && sockCollectionsSequence.Type != JTokenType.Null)
         {
             foreach (JToken sockCollectionsValue in ((JArray)sockCollectionsSequence))
             {
                 Coordinate coordinate = new Coordinate();
                 coordinate.DeserializeJson(sockCollectionsValue);
                 this.SockCollections.Add(coordinate);
             }
         }
         JToken subBrandValue = inputObject["subBrand"];
         if (subBrandValue != null && subBrandValue.Type != JTokenType.Null)
         {
             this.SubBrand = ((string)subBrandValue);
         }
         JToken subBrandDescriptionValue = inputObject["subBrandDescription"];
         if (subBrandDescriptionValue != null && subBrandDescriptionValue.Type != JTokenType.Null)
         {
             this.SubBrandDescription = ((string)subBrandDescriptionValue);
         }
     }
 }