|
| 1 | +/* |
| 2 | +
|
| 3 | +{ |
| 4 | +"body_html": null, |
| 5 | +"created_at": "2013-12-10T03:40:05-05:00", |
| 6 | +"handle": "cheese", |
| 7 | +"id": 191302485, |
| 8 | +"product_type": "General", |
| 9 | +"published_at": "2013-12-10T21:29:21-05:00", |
| 10 | +"published_scope": "global", |
| 11 | +"template_suffix": null, |
| 12 | +"title": "Cheese", |
| 13 | +"updated_at": "2014-02-11T19:37:59-05:00", |
| 14 | +"vendor": "Not specified", |
| 15 | +"tags": "", |
| 16 | +"variants": [ |
| 17 | +{ |
| 18 | +"barcode": null, |
| 19 | +"compare_at_price": null, |
| 20 | +"created_at": "2013-12-10T03:40:05-05:00", |
| 21 | +"fulfillment_service": "manual", |
| 22 | +"grams": 0, |
| 23 | +"id": 437938881, |
| 24 | +"inventory_management": "shopify", |
| 25 | +"inventory_policy": "deny", |
| 26 | +"option1": "Default", |
| 27 | +"option2": null, |
| 28 | +"option3": null, |
| 29 | +"position": 1, |
| 30 | +"price": "23.00", |
| 31 | +"product_id": 191302485, |
| 32 | +"requires_shipping": true, |
| 33 | +"sku": "10061", |
| 34 | +"taxable": true, |
| 35 | +"title": "Default", |
| 36 | +"updated_at": "2013-12-10T03:40:05-05:00", |
| 37 | +"inventory_quantity": 20, |
| 38 | +"old_inventory_quantity": 20 |
| 39 | +} |
| 40 | +], |
| 41 | +"options": [ |
| 42 | +{ |
| 43 | +"id": 228536785, |
| 44 | +"name": "Title", |
| 45 | +"position": 1, |
| 46 | +"product_id": 191302485 |
| 47 | +} |
| 48 | +], |
| 49 | +"images": [ |
| 50 | +{ |
| 51 | +"created_at": "2013-12-10T03:40:12-05:00", |
| 52 | +"id": 391973353, |
| 53 | +"position": 1, |
| 54 | +"product_id": 191302505, |
| 55 | +"updated_at": "2013-12-10T03:40:12-05:00", |
| 56 | +"src": "http://cdn.shopify.com/s/files/1/0199/1250/products/df4331ec645329971ea45cdfb77315fead191d32.jpeg?v=1386664812" |
| 57 | +} |
| 58 | +], |
| 59 | +"image": { |
| 60 | +"created_at": "2013-12-10T03:40:12-05:00", |
| 61 | +"id": 391973353, |
| 62 | +"position": 1, |
| 63 | +"product_id": 191302505, |
| 64 | +"updated_at": "2013-12-10T03:40:12-05:00", |
| 65 | +"src": "http://cdn.shopify.com/s/files/1/0199/1250/products/df4331ec645329971ea45cdfb77315fead191d32.jpeg?v=1386664812" |
| 66 | +} |
| 67 | +}, |
| 68 | +*/ |
| 69 | + |
| 70 | +package shopify |
| 71 | + |
| 72 | +type ShopifyProduct struct { |
| 73 | + BodyHtml string `json:"body_html,omitempty"` |
| 74 | + CreatedAt string `json:"created_at,omitempty"` |
| 75 | + Handle string `json:"handle,omitempty"` |
| 76 | + Id int `json:"id,omitempty"` |
| 77 | + ProductType string `json:"product_type,omitempty"` |
| 78 | + PublishedAt string `json:"published_at,omitempty"` |
| 79 | + PublishedScope string `json:"published_scope,omitempty"` |
| 80 | + TemplateSuffix string `json:"template_suffix,omitempty"` |
| 81 | + Title string `json:"title,omitempty"` |
| 82 | + UpdatedAt string `json:"updated_at,omitempty"` |
| 83 | + Vendor string `json:"vendor,omitempty"` |
| 84 | + Tags string `json:"tags,omitempty"` |
| 85 | + Variants []ShopifyProductVariant `json:"variants,omitempty"` |
| 86 | + Options []ShopifyProductOption `json:"options,omitempty"` |
| 87 | + Images []ShopifyProductImage `json:"images,omitempty"` |
| 88 | + Image ShopifyProductImage `json:"image,omitempty"` |
| 89 | +} |
| 90 | + |
| 91 | +type ShopifyProductVariant struct { |
| 92 | + Barcode string `json:"barcode,omitempty"` |
| 93 | + CompareAtPrice string `json:"compare_at_price,omitempty"` |
| 94 | + CreatedAt string `json:"created_at,omitempty"` |
| 95 | + FulfillmentService string `json:"fulfillment_service,omitempty"` |
| 96 | + Grams int `json:"grams,omitempty"` |
| 97 | + Id int `json:"id,omitempty"` |
| 98 | + InventoryManagement string `json:"inventory_management,omitempty"` |
| 99 | + InventoryPolicy string `json:"inventory_policy,omitempty"` |
| 100 | + Option1 string `json:"option1,omitempty"` |
| 101 | + Option2 string `json:"option2,omitempty"` |
| 102 | + Option3 string `json:"option3,omitempty"` |
| 103 | + Position int `json:"position,omitempty"` |
| 104 | + Price string `json:"price,omitempty"` |
| 105 | + ProductId int `json:"product_id,omitempty"` |
| 106 | + RequiresShipping bool `json:"requires_shopping,omitempty"` |
| 107 | + Sku string `json:"sku,omitempty"` |
| 108 | + Taxable bool `json:"taxable,omitempty"` |
| 109 | + Title string `json:"title,omitempty"` |
| 110 | + UpdatedAt string `json:"updated_at,omitempty"` |
| 111 | + InventoryQuantity float64 `json:"inventory_quantity,omitempty"` |
| 112 | + OldInventoryQuantity int `json:"old_inventory_quantity,omitempty"` |
| 113 | +} |
| 114 | + |
| 115 | +type ShopifyProductOption struct { |
| 116 | + Id int `json:"id,omitempty"` |
| 117 | + Name string `json:"name,omitempty"` |
| 118 | + Position int `json:"position,omitempty"` |
| 119 | + ProductId int `json:"product_id,omitempty"` |
| 120 | +} |
| 121 | + |
| 122 | +type ShopifyProductImage struct { |
| 123 | + CreatedAt string `json:"created_at,omitempty"` |
| 124 | + Id int `json:"id,omitempty"` |
| 125 | + Position int `json:"position,omitempty"` |
| 126 | + ProductId int `json:"product_id,omitempty"` |
| 127 | + UpdatedAt string `json:"updated_at",omitempty"` |
| 128 | + Src string `json:"src,omitempty"` |
| 129 | +} |
| 130 | + |
| 131 | +type ShopifyResponse struct { |
| 132 | + Products []ShopifyProduct `json:"products,omitempty"` |
| 133 | + Product ShopifyProduct `json:"product,omitempty"` |
| 134 | +} |
0 commit comments