Skip to content

Commit f6a94d3

Browse files
committed
Release: v5.0.0
- Support new Recommend Items to Item Segment endpoint - Series API improvements: - Add Series endpoint creates associated Item for the Series automatically (based on the cascadeCreate parameter) - Breaking change: Remove From Series no longer requires the time parameter - Removed deprecated Groups endpoints
1 parent 106a7c7 commit f6a94d3

File tree

91 files changed

+598
-1479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+598
-1479
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,4 @@ public class PropertiesExample
195195

196196
Various errors can occur while processing request, for example because of adding an already existing item or submitting interaction of nonexistent user without *cascadeCreate* set to true. These errors lead to throwing the *ResponseException* by the *send* method of the client. Another reason for throwing an exception is a timeout. *ApiException* is the base class of both *ResponseException* and *TimeoutException*.
197197

198-
We are doing our best to provide the fastest and most reliable service, but production-level applications must implement a fallback solution since errors can always happen. The fallback might be, for example, showing the most popular items from the current category, or not displaying recommendations at all.
198+
We are doing our best to provide the fastest and most reliable service, but production-level applications must implement a fallback solution since errors can always happen. The fallback might be, for example, showing the most popular items from the current category, or not displaying recommendations at all.

Src/Recombee.ApiClient.Tests/AddBookmarkBatchUnitTest.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public void TestAddBookmark()
2525
new AddBookmark("entity_id", "entity_id", timestamp: ParseDateTime("2013-10-29T09:38:41.341Z")),
2626
new AddBookmark("entity_id", "nonex_id"),
2727
new AddBookmark("nonex_id", "entity_id"),
28-
new AddBookmark("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)),
2928
new AddBookmark("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)),
3029
new AddBookmark("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5))
3130
};
@@ -36,9 +35,8 @@ public void TestAddBookmark()
3635
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(2));
3736
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(3));
3837
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(4));
39-
Assert.Equal(400, (int)batchResponse.StatusCodes.ElementAt(5));
40-
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(6));
41-
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(7));
38+
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(5));
39+
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(6));
4240
}
4341

4442
[Fact]
@@ -51,7 +49,6 @@ public async void TestAddBookmarkAsync()
5149
new AddBookmark("entity_id", "entity_id", timestamp: ParseDateTime("2013-10-29T09:38:41.341Z")),
5250
new AddBookmark("entity_id", "nonex_id"),
5351
new AddBookmark("nonex_id", "entity_id"),
54-
new AddBookmark("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)),
5552
new AddBookmark("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)),
5653
new AddBookmark("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5))
5754
};
@@ -62,9 +59,8 @@ public async void TestAddBookmarkAsync()
6259
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(2));
6360
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(3));
6461
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(4));
65-
Assert.Equal(400, (int)batchResponse.StatusCodes.ElementAt(5));
66-
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(6));
67-
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(7));
62+
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(5));
63+
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(6));
6864
}
6965
}
7066
}

Src/Recombee.ApiClient.Tests/AddBookmarkUnitTest.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ public void TestAddBookmark()
4747
{
4848
Assert.Equal(404, (int)ex.StatusCode);
4949
}
50-
// it 'fails with invalid time'
51-
try
52-
{
53-
client.Send(new AddBookmark("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)));
54-
Assert.True(false,"No exception thrown");
55-
}
56-
catch (ResponseException ex)
57-
{
58-
Assert.Equal(400, (int)ex.StatusCode);
59-
}
6050
// it 'really stores interaction to the system'
6151
resp = client.Send(new AddBookmark("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)));
6252
try
@@ -102,16 +92,6 @@ public async void TestAddBookmarkAsync()
10292
{
10393
Assert.Equal(404, (int)ex.StatusCode);
10494
}
105-
// it 'fails with invalid time'
106-
try
107-
{
108-
await client.SendAsync(new AddBookmark("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)));
109-
Assert.True(false,"No exception thrown");
110-
}
111-
catch (ResponseException ex)
112-
{
113-
Assert.Equal(400, (int)ex.StatusCode);
114-
}
11595
// it 'really stores interaction to the system'
11696
resp = await client.SendAsync(new AddBookmark("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)));
11797
try

Src/Recombee.ApiClient.Tests/AddCartAdditionBatchUnitTest.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public void TestAddCartAddition()
2525
new AddCartAddition("entity_id", "entity_id", timestamp: ParseDateTime("2013-10-29T09:38:41.341Z")),
2626
new AddCartAddition("entity_id", "nonex_id"),
2727
new AddCartAddition("nonex_id", "entity_id"),
28-
new AddCartAddition("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)),
2928
new AddCartAddition("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)),
3029
new AddCartAddition("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5))
3130
};
@@ -36,9 +35,8 @@ public void TestAddCartAddition()
3635
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(2));
3736
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(3));
3837
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(4));
39-
Assert.Equal(400, (int)batchResponse.StatusCodes.ElementAt(5));
40-
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(6));
41-
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(7));
38+
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(5));
39+
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(6));
4240
}
4341

4442
[Fact]
@@ -51,7 +49,6 @@ public async void TestAddCartAdditionAsync()
5149
new AddCartAddition("entity_id", "entity_id", timestamp: ParseDateTime("2013-10-29T09:38:41.341Z")),
5250
new AddCartAddition("entity_id", "nonex_id"),
5351
new AddCartAddition("nonex_id", "entity_id"),
54-
new AddCartAddition("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)),
5552
new AddCartAddition("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)),
5653
new AddCartAddition("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5))
5754
};
@@ -62,9 +59,8 @@ public async void TestAddCartAdditionAsync()
6259
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(2));
6360
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(3));
6461
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(4));
65-
Assert.Equal(400, (int)batchResponse.StatusCodes.ElementAt(5));
66-
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(6));
67-
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(7));
62+
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(5));
63+
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(6));
6864
}
6965
}
7066
}

Src/Recombee.ApiClient.Tests/AddCartAdditionUnitTest.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ public void TestAddCartAddition()
4747
{
4848
Assert.Equal(404, (int)ex.StatusCode);
4949
}
50-
// it 'fails with invalid time'
51-
try
52-
{
53-
client.Send(new AddCartAddition("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)));
54-
Assert.True(false,"No exception thrown");
55-
}
56-
catch (ResponseException ex)
57-
{
58-
Assert.Equal(400, (int)ex.StatusCode);
59-
}
6050
// it 'really stores interaction to the system'
6151
resp = client.Send(new AddCartAddition("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)));
6252
try
@@ -102,16 +92,6 @@ public async void TestAddCartAdditionAsync()
10292
{
10393
Assert.Equal(404, (int)ex.StatusCode);
10494
}
105-
// it 'fails with invalid time'
106-
try
107-
{
108-
await client.SendAsync(new AddCartAddition("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)));
109-
Assert.True(false,"No exception thrown");
110-
}
111-
catch (ResponseException ex)
112-
{
113-
Assert.Equal(400, (int)ex.StatusCode);
114-
}
11595
// it 'really stores interaction to the system'
11696
resp = await client.SendAsync(new AddCartAddition("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)));
11797
try

Src/Recombee.ApiClient.Tests/AddDetailViewBatchUnitTest.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public void TestAddDetailView()
2525
new AddDetailView("entity_id", "entity_id", timestamp: ParseDateTime("2013-10-29T09:38:41.341Z")),
2626
new AddDetailView("entity_id", "nonex_id"),
2727
new AddDetailView("nonex_id", "entity_id"),
28-
new AddDetailView("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)),
2928
new AddDetailView("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)),
3029
new AddDetailView("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5))
3130
};
@@ -36,9 +35,8 @@ public void TestAddDetailView()
3635
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(2));
3736
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(3));
3837
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(4));
39-
Assert.Equal(400, (int)batchResponse.StatusCodes.ElementAt(5));
40-
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(6));
41-
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(7));
38+
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(5));
39+
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(6));
4240
}
4341

4442
[Fact]
@@ -51,7 +49,6 @@ public async void TestAddDetailViewAsync()
5149
new AddDetailView("entity_id", "entity_id", timestamp: ParseDateTime("2013-10-29T09:38:41.341Z")),
5250
new AddDetailView("entity_id", "nonex_id"),
5351
new AddDetailView("nonex_id", "entity_id"),
54-
new AddDetailView("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)),
5552
new AddDetailView("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)),
5653
new AddDetailView("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5))
5754
};
@@ -62,9 +59,8 @@ public async void TestAddDetailViewAsync()
6259
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(2));
6360
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(3));
6461
Assert.Equal(404, (int)batchResponse.StatusCodes.ElementAt(4));
65-
Assert.Equal(400, (int)batchResponse.StatusCodes.ElementAt(5));
66-
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(6));
67-
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(7));
62+
Assert.Equal(200, (int)batchResponse.StatusCodes.ElementAt(5));
63+
Assert.Equal(409, (int)batchResponse.StatusCodes.ElementAt(6));
6864
}
6965
}
7066
}

Src/Recombee.ApiClient.Tests/AddDetailViewUnitTest.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ public void TestAddDetailView()
4747
{
4848
Assert.Equal(404, (int)ex.StatusCode);
4949
}
50-
// it 'fails with invalid time'
51-
try
52-
{
53-
client.Send(new AddDetailView("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)));
54-
Assert.True(false,"No exception thrown");
55-
}
56-
catch (ResponseException ex)
57-
{
58-
Assert.Equal(400, (int)ex.StatusCode);
59-
}
6050
// it 'really stores interaction to the system'
6151
resp = client.Send(new AddDetailView("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)));
6252
try
@@ -102,16 +92,6 @@ public async void TestAddDetailViewAsync()
10292
{
10393
Assert.Equal(404, (int)ex.StatusCode);
10494
}
105-
// it 'fails with invalid time'
106-
try
107-
{
108-
await client.SendAsync(new AddDetailView("entity_id", "entity_id", timestamp: UnixTimeStampToDateTime(-15)));
109-
Assert.True(false,"No exception thrown");
110-
}
111-
catch (ResponseException ex)
112-
{
113-
Assert.Equal(400, (int)ex.StatusCode);
114-
}
11595
// it 'really stores interaction to the system'
11696
resp = await client.SendAsync(new AddDetailView("u_id2", "i_id2", cascadeCreate: true, timestamp: UnixTimeStampToDateTime(5)));
11797
try

Src/Recombee.ApiClient.Tests/AddGroupBatchUnitTest.cs

Lines changed: 0 additions & 54 deletions
This file was deleted.

Src/Recombee.ApiClient.Tests/AddGroupUnitTest.cs

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)