Guest User

Untitled

a guest
Jan 17th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.16 KB | None | 0 0
  1. [{"Suppliers": []
  2.  
  3. "StockLevels": [
  4. {
  5. "Location": {
  6. "StockLocationId": "00000000-0000-0000-0000-000000000000",
  7. "LocationName": "Default",
  8. "IsFulfillmentCenter": false,
  9. "LocationTag": null,
  10. "BinRack": "C01-0000"
  11. },
  12. "StockLevel": 100,
  13. "StockValue": 0,
  14. "MinimumLevel": 20,
  15. "InOrderBook": 2,
  16. "Due": 0,
  17. "InOrders": 2,
  18. "Available": 98,
  19. "UnitCost": 0,
  20. "SKU": null,
  21. "AutoAdjust": false,
  22. "LastUpdateDate": "2018-01-02T09:21:35",
  23. "LastUpdateOperation": "OPENING STOCK",
  24. "rowid": "00000000-0000-0000-0000-000000000000",
  25. "PendingUpdate": false,
  26. "StockItemId": "c3566ffc-9a7a-4de1-97eb-77d250a7bf25"
  27. }
  28. ],
  29. "ItemChannelDescriptions": [
  30.  
  31. ],
  32. "ItemExtendedProperties": [
  33.  
  34. ],
  35. "ItemChannelTitles": [
  36.  
  37. ],
  38. "ItemChannelPrices": [
  39.  
  40. ],
  41. "Images": [
  42.  
  43. ],
  44. "ItemNumber": "TEST_SS7050",
  45. "ItemTitle": "TEST_Swan Stabilo Boss Highlighter Yellow",
  46. "BarcodeNumber": "4006381118740",
  47. "MetaData": "Stabilo Boss Highlighter Yellow. The original highlighter since 1972. Available in a choice of attractive fluorescent colors with a long cap off time. The distinctive design stops the pen from rolling away and makes it usable anywhere. Brand quality from Schwann Stabilo, the inventor of the highlighter.",
  48. "isBatchedStockType": false,
  49. "PurchasePrice": 0,
  50. "RetailPrice": null,
  51. "TaxRate": 0,
  52. "PostalServiceId": "00000000-0000-0000-0000-000000000000",
  53. "PostalServiceName": null,
  54. "CategoryId": "b4e35a83-0e63-4e85-995f-5a99ce998fcf",
  55. "CategoryName": "Linnworks Test Category",
  56. "PackageGroupId": "00000000-0000-0000-0000-000000000000",
  57. "PackageGroupName": null,
  58. "Height": 0,
  59. "Width": 0,
  60. "Depth": 0,
  61. "Weight": 0.1,
  62. "CreationDate": "2018-01-02T09:21:36.163",
  63. "InventoryTrackingType": 0,
  64. "BatchNumberScanRequired": false,
  65. "SerialNumberScanRequired": false,
  66. "StockItemId": "c3566ffc-9a7a-4de1-97eb-77d250a7bf25"}]
  67.  
  68. public class fromJSON{
  69. public cls_Suppliers[] Suppliers;
  70. public cls_StockLevels[] StockLevels;
  71. public cls_ItemChannelDescriptions[] ItemChannelDescriptions;
  72. public cls_ItemExtendedProperties[] ItemExtendedProperties;
  73. public cls_ItemChannelTitles[] ItemChannelTitles;
  74. public cls_ItemChannelPrices[] ItemChannelPrices;
  75. public cls_Images[] Images;
  76. public String ItemNumber; //TEST_SS7050
  77. public String ItemTitle; //TEST_Swan Stabilo Boss Highlighter Yellow
  78. public String BarcodeNumber; //4006381118740
  79. public String MetaData; //Stabilo Boss Highlighter Yellow. The original highlighter since 1972. Available in a choice of attractive fluorescent colors with a long cap off time. The distinctive design stops the pen from rolling away and makes it usable anywhere. Brand quality from Schwann Stabilo, the inventor of the highlighter.
  80. public boolean isBatchedStockType;
  81. public Double PurchasePrice; //0
  82. public cls_RetailPrice RetailPrice;
  83. public Double TaxRate; //0
  84. public String PostalServiceId; //00000000-0000-0000-0000-000000000000
  85. public cls_PostalServiceName PostalServiceName;
  86. public String CategoryId; //b4e35a83-0e63-4e85-995f-5a99ce998fcf
  87. public String CategoryName; //Linnworks Test Category
  88. public String PackageGroupId; //00000000-0000-0000-0000-000000000000
  89. public cls_PackageGroupName PackageGroupName;
  90. public Double Height; //0
  91. public Double Width; //0
  92. public Double Depth; //0
  93. public Double Weight; //0.1
  94. public String CreationDate; //2018-01-02T09:21:36.163
  95. public Integer InventoryTrackingType; //0
  96. public boolean BatchNumberScanRequired;
  97. public boolean SerialNumberScanRequired;
  98. public String StockItemId; //c3566ffc-9a7a-4de1-97eb-77d250a7bf25
  99.  
  100. public class cls_StockLevels {
  101. public cls_Location Location;
  102. public Integer StockLevel; //100
  103. public Double StockValue; //0
  104. public Integer MinimumLevel; //20
  105. public Integer InOrderBook; //2
  106. public Integer Due; //0
  107. public Integer InOrders; //2
  108. public Integer Available; //98
  109. public Double UnitCost; //0
  110. public String SKU;
  111. public boolean AutoAdjust;
  112. public String LastUpdateDate; //2018-01-02T09:21:35
  113. public String LastUpdateOperation; //OPENING STOCK
  114. public String rowid; //00000000-0000-0000-0000-000000000000
  115. public boolean PendingUpdate;
  116. public String StockItemId; //c3566ffc-9a7a-4de1-97eb-77d250a7bf25
  117. }
  118. class cls_Suppliers {
  119. }
  120. class cls_Location {
  121. public String StockLocationId; //00000000-0000-0000-0000-000000000000
  122. public String LocationName; //Default
  123. public boolean IsFulfillmentCenter;
  124. public cls_LocationTag LocationTag;
  125. public String BinRack; //C01-0000
  126. }
  127. class cls_LocationTag {
  128. }
  129. class cls_SKU {
  130. }
  131. class cls_ItemChannelDescriptions {
  132. }
  133. class cls_ItemExtendedProperties {
  134. }
  135. class cls_ItemChannelTitles {
  136. }
  137. class cls_ItemChannelPrices {
  138. }
  139. class cls_Images {
  140. }
  141. class cls_RetailPrice {
  142. }
  143. class cls_PostalServiceName {
  144. }
  145. class cls_PackageGroupName {
  146. }
  147. public static fromJSON parse(String json){
  148. return (fromJSON) System.JSON.deserialize(json, fromJSON.class);
  149. }}
  150.  
  151. List<fromJSON>response= (List<fromJSON>)JSON.deserialize(res.getBody(), List<fromJSON>.class);
  152. Map<String, Integer> myMap = new Map<String, Integer>();
  153. for(fromJSON.cls_StockLevels result: response.StockLevel) {
  154. myMap.put(result.SKU, result.Available);
  155. System.debug('MAP: '+ myMap);
  156. }
Add Comment
Please, Sign In to add comment