Пример #1
0
        public Listing(Etsy.Listing data)
        {
            Materials = new Dictionary <string, int>();
            this.data = data;
            Name      = data.Title;
            ID        = data.Listing_Id.ToString();
            if (data.MainImage != null)
            {
                Image = data.MainImage.Url_Fullxfull;
            }

            //Add products
            if (data.Inventory != null)
            {
                Products = new Product[data.Inventory.Products.Length];
                for (int i = 0; i < Products.Length; i++)
                {
                    Products[i] = new Product(data.Inventory.Products[i], ID);
                }
            }
            else
            {
                Products = null;
            }
        }
Пример #2
0
 public static Listing GetListing(EtsyApi api, string listingId)
 {
     Etsy.Listing data = api.getListing(listingId, includes: "Inventory")[0];
     return(new Listing(data));
 }