Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Src/Recombee.ApiClient/Bindings/Bookmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>Bookmark Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class Bookmark: RecombeeBinding {
private readonly string userId;
/// <summary>User who bookmarked the item</summary>
[JsonProperty("userId")]
public string UserId
{
get {return userId;}
}
private readonly string itemId;
/// <summary>Bookmarked item</summary>
[JsonProperty("itemId")]
public string ItemId
{
get {return itemId;}
Expand All @@ -30,18 +30,21 @@ public string ItemId
private readonly DateTime? timestamp;
/// <summary>UTC timestamp of the bookmark as ISO8601-1 pattern or UTC epoch time. The default value is the current time.</summary>
[JsonConverter(typeof(EpochJsonReader))]
[JsonProperty("timestamp")]
public DateTime? Timestamp
{
get {return timestamp;}
}
private readonly string recommId;
/// <summary>If this bookmark is based on a recommendation request, `recommId` is the id of the clicked recommendation.</summary>
[JsonProperty("recommId")]
public string RecommId
{
get {return recommId;}
}
private readonly Dictionary<string, object> additionalData;
/// <summary>A dictionary of additional data for the interaction.</summary>
[JsonProperty("additionalData")]
public Dictionary<string, object> AdditionalData
{
get {return additionalData;}
Expand Down
9 changes: 7 additions & 2 deletions Src/Recombee.ApiClient/Bindings/CartAddition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>CartAddition Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class CartAddition: RecombeeBinding {
private readonly string userId;
/// <summary>User who added the item to the cart</summary>
[JsonProperty("userId")]
public string UserId
{
get {return userId;}
}
private readonly string itemId;
/// <summary>Item added to the cart</summary>
[JsonProperty("itemId")]
public string ItemId
{
get {return itemId;}
Expand All @@ -30,30 +30,35 @@ public string ItemId
private readonly DateTime? timestamp;
/// <summary>UTC timestamp of the cart addition as ISO8601-1 pattern or UTC epoch time. The default value is the current time.</summary>
[JsonConverter(typeof(EpochJsonReader))]
[JsonProperty("timeStamp")]
public DateTime? Timestamp
{
get {return timestamp;}
}
private readonly double? amount;
/// <summary>Amount (number) added to cart. The default is 1. For example if `user-x` adds two `item-y` during a single order (session...), the `amount` should equal to 2.</summary>
[JsonProperty("amount")]
public double? Amount
{
get {return amount;}
}
private readonly double? price;
/// <summary>Price of the added item. If `amount` is greater than 1, sum of prices of all the items should be given.</summary>
[JsonProperty("price")]
public double? Price
{
get {return price;}
}
private readonly string recommId;
/// <summary>If this cart addition is based on a recommendation request, `recommId` is the id of the clicked recommendation.</summary>
[JsonProperty("recommId")]
public string RecommId
{
get {return recommId;}
}
private readonly Dictionary<string, object> additionalData;
/// <summary>A dictionary of additional data for the interaction.</summary>
[JsonProperty("additionalData")]
public Dictionary<string, object> AdditionalData
{
get {return additionalData;}
Expand Down
8 changes: 6 additions & 2 deletions Src/Recombee.ApiClient/Bindings/DetailView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>DetailView Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class DetailView: RecombeeBinding {
private readonly string userId;
/// <summary>User who viewed the item</summary>
[JsonProperty("userId")]
public string UserId
{
get {return userId;}
}
private readonly string itemId;
/// <summary>Viewed item</summary>
[JsonProperty("itemId")]
public string ItemId
{
get {return itemId;}
Expand All @@ -30,24 +30,28 @@ public string ItemId
private readonly DateTime? timestamp;
/// <summary>UTC timestamp of the view as ISO8601-1 pattern or UTC epoch time. The default value is the current time.</summary>
[JsonConverter(typeof(EpochJsonReader))]
[JsonProperty("timestamp")]
public DateTime? Timestamp
{
get {return timestamp;}
}
private readonly long? duration;
/// <summary>Duration of the view</summary>
[JsonProperty("duration")]
public long? Duration
{
get {return duration;}
}
private readonly string recommId;
/// <summary>If this detail view is based on a recommendation request, `recommId` is the id of the clicked recommendation.</summary>
[JsonProperty("recommId")]
public string RecommId
{
get {return recommId;}
}
private readonly Dictionary<string, object> additionalData;
/// <summary>A dictionary of additional data for the interaction.</summary>
[JsonProperty("additionalData")]
public Dictionary<string, object> AdditionalData
{
get {return additionalData;}
Expand Down
2 changes: 2 additions & 0 deletions Src/Recombee.ApiClient/Bindings/Entity.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Recombee.ApiClient.Bindings
{
Expand All @@ -9,6 +10,7 @@ public abstract class Entity: RecombeeBinding
private readonly Dictionary<string, object> values;

/// <summary>Values of properties</summary>
[JsonProperty("values")]
public Dictionary<string, object> Values
{
get
Expand Down
3 changes: 1 addition & 2 deletions Src/Recombee.ApiClient/Bindings/Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>Group Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class Group: Entity {
private readonly string groupId;
/// <summary>Id of the group</summary>
[JsonProperty("groupId")]
public string GroupId
{
get {return groupId;}
Expand Down
4 changes: 2 additions & 2 deletions Src/Recombee.ApiClient/Bindings/GroupItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>GroupItem Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class GroupItem: RecombeeBinding {
private readonly string itemType;
/// <summary>`item` iff the regular item from the catalog is to be inserted, `group` iff group is inserted as the item.</summary>
[JsonProperty("itemType")]
public string ItemType
{
get {return itemType;}
}
private readonly string itemId;
/// <summary>ID of the item iff `itemType` is `item`. ID of the group iff `itemType` is `group`.</summary>
[JsonProperty("itemId")]
public string ItemId
{
get {return itemId;}
Expand Down
3 changes: 1 addition & 2 deletions Src/Recombee.ApiClient/Bindings/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>Item Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class Item: Entity {
private readonly string itemId;
/// <summary>Id of the item</summary>
[JsonProperty("itemId")]
public string ItemId
{
get {return itemId;}
Expand Down
4 changes: 2 additions & 2 deletions Src/Recombee.ApiClient/Bindings/Logic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>Logic Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class Logic: RecombeeBinding {
private readonly string name;
/// <summary>Name of the logic that should be used</summary>
[JsonProperty("name")]
public string Name
{
get {return name;}
}
private readonly Dictionary<string, object> settings;
/// <summary>Parameters passed to the logic</summary>
[JsonProperty("settings")]
public Dictionary<string, object> Settings
{
get {return settings;}
Expand Down
4 changes: 2 additions & 2 deletions Src/Recombee.ApiClient/Bindings/PropertyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>PropertyInfo Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class PropertyInfo: RecombeeBinding {
private readonly string name;
/// <summary>Name of the property</summary>
[JsonProperty("name")]
public string Name
{
get {return name;}
}
private readonly string type;
/// <summary>Type of the property</summary>
[JsonProperty("type")]
public string Type
{
get {return type;}
Expand Down
10 changes: 8 additions & 2 deletions Src/Recombee.ApiClient/Bindings/Purchase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

using Recombee.ApiClient.Util;

namespace Recombee.ApiClient.Bindings
{
/// <summary>Purchase Binding</summary>
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class Purchase: RecombeeBinding {
private readonly string userId;
/// <summary>User who purchased the item</summary>
[JsonProperty("userId")]
public string UserId
{
get {return userId;}
}
private readonly string itemId;
/// <summary>Purchased item</summary>
[JsonProperty("itemId")]
public string ItemId
{
get {return itemId;}
Expand All @@ -30,36 +30,42 @@ public string ItemId
private readonly DateTime? timestamp;
/// <summary>UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time. The default value is the current time.</summary>
[JsonConverter(typeof(EpochJsonReader))]
[JsonProperty("timestamp")]
public DateTime? Timestamp
{
get {return timestamp;}
}
private readonly double? amount;
/// <summary>Amount (number) of purchased items. The default is 1. For example if `user-x` purchases two `item-y` during a single order (session...), the `amount` should equal to 2.</summary>
[JsonProperty("amount")]
public double? Amount
{
get {return amount;}
}
private readonly double? price;
/// <summary>Price paid by the user for the item. If `amount` is greater than 1, sum of prices of all the items should be given.</summary>
[JsonProperty("price")]
public double? Price
{
get {return price;}
}
private readonly double? profit;
/// <summary>Your profit from the purchased item. The profit is natural in e-commerce domain (for example if `user-x` purchases `item-y` for $100 and the gross margin is 30 %, then the profit is $30), but is applicable also in other domains (for example at a news company it may be income from displayed advertisement on article page). If `amount` is greater than 1, sum of profit of all the items should be given.</summary>
[JsonProperty("profit")]
public double? Profit
{
get {return profit;}
}
private readonly string recommId;
/// <summary>If this purchase is based on a recommendation request, `recommId` is the id of the clicked recommendation.</summary>
[JsonProperty("recommId")]
public string RecommId
{
get {return recommId;}
}
private readonly Dictionary<string, object> additionalData;
/// <summary>A dictionary of additional data for the interaction.</summary>
[JsonProperty("additionalData")]
public Dictionary<string, object> AdditionalData
{
get {return additionalData;}
Expand Down
Loading