Skip to content

Commit

Permalink
Update to API version 2.1.8 (#7)
Browse files Browse the repository at this point in the history
- Enable differential downloads
- Add test
  • Loading branch information
iavorJ committed May 19, 2020
1 parent 30ac503 commit f19f5c6
Show file tree
Hide file tree
Showing 6 changed files with 421 additions and 12 deletions.
32 changes: 32 additions & 0 deletions src/Meplato.Store2.Tests/Products/ScrollTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,37 @@ public async Task ScrollUpdate()
Assert.NotNull(product.Updated);
}
}

[Test]
public async Task ScrollDifferentialUpdate()
{
var service = GetProductsService();
Assert.NotNull(service);

MockFromFile("products.scroll.differential.success");
var response = await service.Scroll().Pin("AD8CCDD5F9").Area("work").Version(3).Mode("diff").Do();
Assert.NotNull(response);
Assert.AreEqual("store#products", response.Kind);
Assert.IsNotNull(response.PageToken);
Assert.IsNotEmpty(response.PageToken);
Assert.IsTrue(response.TotalItems > 0);
if (response.Items != null)
foreach (var product in response.Items)
{
Assert.NotNull(product);
Assert.IsNotNull(product.Id);
Assert.IsNotEmpty(product.Id);
Assert.IsNotNull(product.Kind);
Assert.IsNotEmpty(product.Kind);
Assert.IsNotNull(product.SelfLink);
Assert.IsNotEmpty(product.SelfLink);
Assert.IsNotNull(product.Spn);
Assert.IsNotEmpty(product.Spn);
Assert.IsNotNull(product.Mode);
Assert.IsNotEmpty(product.Mode);
Assert.NotNull(product.Created);
Assert.NotNull(product.Updated);
}
}
}
}
311 changes: 311 additions & 0 deletions src/Meplato.Store2.Tests/TestData/products.scroll.differential.success
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
HTTP/1.1 200 OK
Cache-Control: private, no-cache
Content-Type: application/json; charset=utf-8
Last-Modified: Tue, 31 Mar 2015 14:54:37 GMT
P3p: CP="This is not a P3P policy!"
Vary: Cookie
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Ua-Compatible: IE=edge
X-Xss-Protection: 1; mode=block
Date: Tue, 31 Mar 2015 14:54:37 GMT

{
"kind": "store#products",
"selfLink": "https://store2.meplato.com/api/v2/catalogs/AD8CCDD5F9/work/products/scroll?pretty=1\u0026pageToken=c2NhbjsyOzc1OTpFUDU3a3FNelNPdWlzR1dnZFNsTFJBOzc2MDpFUDU3a3FNelNPdWlzR1dnZFNsTFJBOzE7dG90YWxfaGl0czo5ODYyMTs=",
"nextLink": "https://store2.meplato.com/api/v2/catalogs/AD8CCDD5F9/work/products/scroll?pageToken=c2NhbjsyOzc1OTpFUDU3a3FNelNPdWlzR1dnZFNsTFJBOzc2MDpFUDU3a3FNelNPdWlzR1dnZFNsTFJBOzE7dG90YWxfaGl0czo5ODYyMTs%3D\u0026pretty=1",
"pageToken": "c2NhbjsyOzc1OTpFUDU3a3FNelNPdWlzR1dnZFNsTFJBOzc2MDpFUDU3a3FNelNPdWlzR1dnZFNsTFJBOzE7dG90YWxfaGl0czo5ODYyMTs=",
"totalItems": 3,
"items": [
{
"kind": "store#product",
"selfLink": "https://store2.meplato.com/api/v2/catalogs/AD8CCDD5F9/work/products/50763599?pretty=1",
"id": "50763599@12",
"merchantId": 8,
"projectId": 1,
"catalogId": 12,
"spn": "50763599",
"name": "Heller BOHRER SORT. IN KASETTE 9TLG. 273824",
"description": "Bohrerkassette\n\n 9-teilig, bestehend aus:\nBeton-/Steinbohrer Power 3000\n4/5/6/8 mm\nHSS-G-Super-Stahlbohrer 900\n3/4/5/6/8 mm",
"keywords": null,
"categories": [],
"eclasses": [
{
"version": "5.1",
"code": "21010100"
}
],
"unspscs": [],
"scalePrices": [],
"currency": "EUR",
"priceQty": 1,
"ou": "PK",
"cuPerOu": 1,
"cu": "PCE",
"leadtime": 5,
"quantityMin": 1,
"quantityMax": null,
"quantityInterval": 1,
"taxCode": "0.190000",
"conditions": null,
"gtin": "4010159273824 ",
"bpn": "",
"mpn": "4010159273824",
"manufacturer": "ITW Heller GmbH",
"manufactcode": "",
"image": "50763599.jpg",
"thumbnail": "",
"datasheet": "",
"safetysheet": "",
"hazmats": [
{
"kind": "Gefahrgut",
"text": "NONE"
}
],
"matgroup": "",
"erpGroupSupplier": "",
"extSchemaType": "",
"extCategoryId": "",
"extCategory": "",
"custField1": "",
"custField2": "",
"custField3": "",
"custField4": "",
"custField5": "",
"references": [
{
"kind": "others",
"spn": "505533",
"qty": 1
},
{
"kind": "others",
"spn": "518929",
"qty": 1
},
{
"kind": "others",
"spn": "518930",
"qty": 1
},
{
"kind": "others",
"spn": "518931",
"qty": 1
},
{
"kind": "others",
"spn": "50539736",
"qty": 1
},
{
"kind": "others",
"spn": "50539771",
"qty": 1
},
{
"kind": "others",
"spn": "50581235",
"qty": 1
},
{
"kind": "others",
"spn": "50765466",
"qty": 1
}
],
"features": [],
"availability": {
"qty": 0
},
"messages": [],
"tags": null,
"imageURL": "https://store2.meplato.com/abc-elektronik/media?file=50763599.jpg\u0026h=230\u0026w=330",
"thumbnailURL": "https://store2.meplato.com/abc-elektronik/media?file=50763599.jpg\u0026h=90\u0026w=90",
"price": 10.92,
"extProductId": "50763599@12",
"mode": "Created",
"created": "2015-03-20T13:11:02Z",
"updated": "2015-03-20T13:11:02Z"
},
{
"kind": "store#product",
"selfLink": "https://store2.meplato.com/api/v2/catalogs/AD8CCDD5F9/work/products/50763601?pretty=1",
"id": "50763601@12",
"merchantId": 8,
"projectId": 1,
"catalogId": 12,
"spn": "50763601",
"name": "Heller QUICK-BIT KASS. 5TLG. HOLZ 265690",
"description": "QuickBit®-Satz Holz\n\n 5-teilig\n\n Inhalt: 3, 4, 5, 6, 8 mm",
"keywords": null,
"categories": [],
"eclasses": [
{
"version": "5.1",
"code": "21040190"
}
],
"unspscs": [],
"scalePrices": [],
"currency": "EUR",
"priceQty": 1,
"ou": "PK",
"cuPerOu": 1,
"cu": "PCE",
"leadtime": 5,
"quantityMin": 1,
"quantityMax": null,
"quantityInterval": 1,
"taxCode": "0.190000",
"conditions": null,
"gtin": "4010159265690 ",
"bpn": "",
"mpn": "4010159265690",
"manufacturer": "ITW Heller GmbH",
"manufactcode": "",
"image": "50763601.jpg",
"thumbnail": "",
"datasheet": "",
"safetysheet": "",
"hazmats": [
{
"kind": "Gefahrgut",
"text": "NONE"
}
],
"matgroup": "",
"erpGroupSupplier": "",
"extSchemaType": "",
"extCategoryId": "",
"extCategory": "",
"custField1": "",
"custField2": "",
"custField3": "",
"custField4": "",
"custField5": "",
"references": [
{
"kind": "others",
"spn": "505533",
"qty": 1
},
{
"kind": "others",
"spn": "518929",
"qty": 1
},
{
"kind": "others",
"spn": "518930",
"qty": 1
},
{
"kind": "others",
"spn": "518931",
"qty": 1
},
{
"kind": "others",
"spn": "50539736",
"qty": 1
},
{
"kind": "others",
"spn": "50539771",
"qty": 1
},
{
"kind": "others",
"spn": "50581235",
"qty": 1
},
{
"kind": "others",
"spn": "50765466",
"qty": 1
}
],
"features": [],
"availability": {
"qty": 0
},
"messages": [],
"tags": null,
"imageURL": "https://store2.meplato.com/abc-elektronik/media?file=50763601.jpg\u0026h=230\u0026w=330",
"thumbnailURL": "https://store2.meplato.com/abc-elektronik/media?file=50763601.jpg\u0026h=90\u0026w=90",
"price": 11.68,
"extProductId": "50763601@12",
"mode": "Updated",
"created": "2015-03-20T13:11:02Z",
"updated": "2015-03-20T15:51:32Z"
},
{
"kind": "store#product",
"selfLink": "https://store2.meplato.com/api/v2/catalogs/AD8CCDD5F9/work/products/50763603?pretty=1",
"id": "50763603@12",
"merchantId": 0,
"projectId": 0,
"catalogId": 0,
"spn": "50763603",
"name": "",
"description": "",
"keywords": null,
"categories": null,
"eclasses": null,
"unspscs": null,
"currency": "",
"country": "",
"priceQty": 0,
"ou": "",
"cuPerOu": 0,
"cu": "",
"leadtime": null,
"quantityMin": null,
"quantityMax": null,
"quantityInterval": null,
"taxCode": "",
"taxRate": 0,
"conditions": null,
"gtin": "",
"asin": "",
"bpn": "",
"mpn": "",
"manufacturer": "",
"manufactcode": "",
"image": "",
"thumbnail": "",
"datasheet": "",
"safetysheet": "",
"blobs": null,
"hazmats": null,
"intrastat": null,
"matgroup": "",
"erpGroupSupplier": "",
"extSchemaType": "",
"extCategoryId": "",
"extCategory": "",
"extProductId": "",
"multiSupplierId": "",
"multiSupplierName": "",
"custField1": "",
"custField2": "",
"custField3": "",
"custField4": "",
"custField5": "",
"custFields": null,
"references": null,
"features": null,
"availability": null,
"messages": null,
"tags": null,
"excluded": false,
"catalogManaged": false,
"price": 0,
"mode": "Deleted",
"created": "0001-01-01T00:00:00Z",
"updated": "0001-01-01T00:00:00Z"
}
]
}
4 changes: 2 additions & 2 deletions src/Meplato.Store2/Catalogs/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// The file implements the Meplato Store API.
//
// Author: Meplato API Team <support@meplato.com>
// Version: 2.1.7
// Version: 2.1.8
// License: Copyright (c) 2015-2020 Meplato GmbH. All rights reserved.
// See <a href="https://developer.meplato.com/store2/#terms">Terms of Service</a>
// See <a href="https://developer.meplato.com/store2/">External documentation</a>
Expand All @@ -40,7 +40,7 @@ public class Service
{
#region Service
public const string Title = "Meplato Store API";
public const string Version = "2.1.7";
public const string Version = "2.1.8";
public const string UserAgent = "meplato-csharp-client/2.0";
public const string DefaultBaseURL = "https://store.meplato.com/api/v2";

Expand Down
4 changes: 2 additions & 2 deletions src/Meplato.Store2/Jobs/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// The file implements the Meplato Store API.
//
// Author: Meplato API Team <support@meplato.com>
// Version: 2.1.7
// Version: 2.1.8
// License: Copyright (c) 2015-2020 Meplato GmbH. All rights reserved.
// See <a href="https://developer.meplato.com/store2/#terms">Terms of Service</a>
// See <a href="https://developer.meplato.com/store2/">External documentation</a>
Expand All @@ -40,7 +40,7 @@ public class Service
{
#region Service
public const string Title = "Meplato Store API";
public const string Version = "2.1.7";
public const string Version = "2.1.8";
public const string UserAgent = "meplato-csharp-client/2.0";
public const string DefaultBaseURL = "https://store.meplato.com/api/v2";

Expand Down
Loading

0 comments on commit f19f5c6

Please sign in to comment.