Visitar URL original
Release: v6.3.0 · alativity/java-api-client@2dc8a44 · GitHub
Skip to content

Commit 2dc8a44

Browse files
committed
Release: v6.3.0
- Added support for property roles and metadata
1 parent 5b85a7c commit 2dc8a44

89 files changed

Lines changed: 464 additions & 72 deletions

File tree

Some content is hidden

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

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The client is available in the [Maven Central Repository](https://mvnrepository.
1313
<dependency>
1414
<groupId>com.recombee</groupId>
1515
<artifactId>api-client</artifactId>
16-
<version>6.2.1</version>
16+
<version>6.3.0</version>
1717
</dependency>
1818
```
1919

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.recombee</groupId>
88
<artifactId>api-client</artifactId>
9-
<version>6.2.1</version>
9+
<version>6.3.0</version>
1010
<name>Recombee API Client</name>
1111
<description>A client library for easy use of the Recombee recommendation API</description>
1212
<url>https://www.recombee.com</url>

‎src/main/java/com/recombee/api_client/RecombeeClient.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public class RecombeeClient {
100100

101101
final int BATCH_MAX_SIZE = 10000; //Maximal number of requests within one batch request
102102

103-
final String USER_AGENT = "recombee-java-api-client/6.2.1";
103+
final String USER_AGENT = "recombee-java-api-client/6.3.0";
104104

105105
private int connectionPoolMaxIdleConnections = 32;
106106
private long connectionPoolKeepAliveDuration = 5;

‎src/main/java/com/recombee/api_client/api_requests/AddBookmark.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import com.recombee.api_client.bindings.Logic;
1212
import com.recombee.api_client.bindings.CompositeRecommendationStageParameters;
13+
import com.recombee.api_client.bindings.PropertyRole;
14+
import com.recombee.api_client.bindings.PropertyMetadata;
1315
import com.recombee.api_client.util.HTTPMethod;
1416

1517
/**

‎src/main/java/com/recombee/api_client/api_requests/AddCartAddition.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import com.recombee.api_client.bindings.Logic;
1212
import com.recombee.api_client.bindings.CompositeRecommendationStageParameters;
13+
import com.recombee.api_client.bindings.PropertyRole;
14+
import com.recombee.api_client.bindings.PropertyMetadata;
1315
import com.recombee.api_client.util.HTTPMethod;
1416

1517
/**

‎src/main/java/com/recombee/api_client/api_requests/AddDetailView.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import com.recombee.api_client.bindings.Logic;
1212
import com.recombee.api_client.bindings.CompositeRecommendationStageParameters;
13+
import com.recombee.api_client.bindings.PropertyRole;
14+
import com.recombee.api_client.bindings.PropertyMetadata;
1315
import com.recombee.api_client.util.HTTPMethod;
1416

1517
/**

‎src/main/java/com/recombee/api_client/api_requests/AddItem.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import com.recombee.api_client.bindings.Logic;
1212
import com.recombee.api_client.bindings.CompositeRecommendationStageParameters;
13+
import com.recombee.api_client.bindings.PropertyRole;
14+
import com.recombee.api_client.bindings.PropertyMetadata;
1315
import com.recombee.api_client.util.HTTPMethod;
1416

1517
/**

‎src/main/java/com/recombee/api_client/api_requests/AddItemProperty.java‎

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import com.recombee.api_client.bindings.Logic;
1212
import com.recombee.api_client.bindings.CompositeRecommendationStageParameters;
13+
import com.recombee.api_client.bindings.PropertyRole;
14+
import com.recombee.api_client.bindings.PropertyMetadata;
1315
import com.recombee.api_client.util.HTTPMethod;
1416

1517
/**
@@ -23,36 +25,59 @@ public class AddItemProperty extends Request {
2325
protected String propertyName;
2426
/**
2527
* Value type of the item property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`, `image` or `imageList`.
26-
* * `int`- Signed integer number.
28+
* * `int` - Signed integer number.
2729
* * `double` - Floating point number. It uses 64-bit base-2 format (IEEE 754 standard).
2830
* * `string` - UTF-8 string.
2931
* * `boolean` - *true* / *false*
30-
* * `timestamp` - Value representing date and time.
32+
* * `timestamp` - Value representing date and time. ISO8601-1 pattern (string) or UTC epoch time (number).
3133
* * `set` - Set of strings.
3234
* * `image` - URL of an image (`jpeg`, `png` or `gif`).
33-
* * `imageList` - List of URLs that refer to images.
35+
* * `imageList` - List of URLs that refer to images.
3436
*/
3537
protected String type;
38+
/**
39+
* [Role](https://docs.recombee.com/api/property_roles_metadata#roles) to assign to the property.
40+
*/
41+
protected PropertyRole role;
42+
/**
43+
* List of [metadata](https://docs.recombee.com/api/property_roles_metadata#metadata) entries to assign to the property.
44+
*/
45+
protected PropertyMetadata[] metadata;
3646

3747
/**
3848
* Construct the request
3949
* @param propertyName Name of the item property to be created. Currently, the following names are reserved: `id`, `itemid`, case-insensitively. Also, the length of the property name must not exceed 63 characters.
4050
* @param type Value type of the item property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`, `image` or `imageList`.
41-
* * `int`- Signed integer number.
51+
* * `int` - Signed integer number.
4252
* * `double` - Floating point number. It uses 64-bit base-2 format (IEEE 754 standard).
4353
* * `string` - UTF-8 string.
4454
* * `boolean` - *true* / *false*
45-
* * `timestamp` - Value representing date and time.
55+
* * `timestamp` - Value representing date and time. ISO8601-1 pattern (string) or UTC epoch time (number).
4656
* * `set` - Set of strings.
4757
* * `image` - URL of an image (`jpeg`, `png` or `gif`).
48-
* * `imageList` - List of URLs that refer to images.
58+
* * `imageList` - List of URLs that refer to images.
4959
*/
5060
public AddItemProperty (String propertyName,String type) {
5161
this.propertyName = propertyName;
5262
this.type = type;
5363
this.timeout = 100000;
5464
}
5565

66+
/**
67+
* @param role [Role](https://docs.recombee.com/api/property_roles_metadata#roles) to assign to the property.
68+
*/
69+
public AddItemProperty setRole(PropertyRole role) {
70+
this.role = role;
71+
return this;
72+
}
73+
74+
/**
75+
* @param metadata List of [metadata](https://docs.recombee.com/api/property_roles_metadata#metadata) entries to assign to the property.
76+
*/
77+
public AddItemProperty setMetadata(PropertyMetadata[] metadata) {
78+
this.metadata = metadata;
79+
return this;
80+
}
5681

5782
public String getPropertyName() {
5883
return this.propertyName;
@@ -62,6 +87,14 @@ public String getType() {
6287
return this.type;
6388
}
6489

90+
public PropertyRole getRole() {
91+
return this.role;
92+
}
93+
94+
public PropertyMetadata[] getMetadata() {
95+
return this.metadata;
96+
}
97+
6598
/**
6699
* @return Used HTTP method
67100
*/
@@ -85,7 +118,6 @@ public String getPath() {
85118
@Override
86119
public Map<String, Object> getQueryParameters() {
87120
HashMap<String, Object> params = new HashMap<String, Object>();
88-
params.put("type", this.type.toString());
89121
return params;
90122
}
91123

@@ -96,6 +128,13 @@ public Map<String, Object> getQueryParameters() {
96128
@Override
97129
public Map<String, Object> getBodyParameters() {
98130
HashMap<String, Object> params = new HashMap<String, Object>();
131+
params.put("type", this.type);
132+
if (this.role!=null) {
133+
params.put("role", this.role);
134+
}
135+
if (this.metadata!=null) {
136+
params.put("metadata", this.metadata);
137+
}
99138
return params;
100139
}
101140

‎src/main/java/com/recombee/api_client/api_requests/AddManualReqlSegment.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import com.recombee.api_client.bindings.Logic;
1212
import com.recombee.api_client.bindings.CompositeRecommendationStageParameters;
13+
import com.recombee.api_client.bindings.PropertyRole;
14+
import com.recombee.api_client.bindings.PropertyMetadata;
1315
import com.recombee.api_client.util.HTTPMethod;
1416

1517
/**

‎src/main/java/com/recombee/api_client/api_requests/AddPurchase.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import com.recombee.api_client.bindings.Logic;
1212
import com.recombee.api_client.bindings.CompositeRecommendationStageParameters;
13+
import com.recombee.api_client.bindings.PropertyRole;
14+
import com.recombee.api_client.bindings.PropertyMetadata;
1315
import com.recombee.api_client.util.HTTPMethod;
1416

1517
/**

0 commit comments

Comments
 (0)