Skip to content

Commit 1ceab07

Browse files
Merge branch 'main' into fix/predict-error-spec
2 parents 066fa34 + 53ec9e1 commit 1ceab07

File tree

23 files changed

+1510
-142
lines changed

23 files changed

+1510
-142
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/PredictClient.java

Lines changed: 148 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,145 @@ public CompletableFuture<Object> delAsync(String path) throws AlgoliaRuntimeExce
189189
return this.delAsync(path, null, null);
190190
}
191191

192+
/**
193+
* Delete all data and predictions associated with an authenticated user (userID) or an anonymous
194+
* user (cookieID, sessionID).
195+
*
196+
* @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users
197+
* (visitors). (required)
198+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
199+
* the transporter requestOptions.
200+
* @return DeleteUserProfileResponse
201+
* @throws AlgoliaRuntimeException If it fails to process the API call
202+
*/
203+
public DeleteUserProfileResponse deleteUserProfile(String userID, RequestOptions requestOptions) throws AlgoliaRuntimeException {
204+
return LaunderThrowable.await(deleteUserProfileAsync(userID, requestOptions));
205+
}
206+
207+
/**
208+
* Delete all data and predictions associated with an authenticated user (userID) or an anonymous
209+
* user (cookieID, sessionID).
210+
*
211+
* @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users
212+
* (visitors). (required)
213+
* @return DeleteUserProfileResponse
214+
* @throws AlgoliaRuntimeException If it fails to process the API call
215+
*/
216+
public DeleteUserProfileResponse deleteUserProfile(String userID) throws AlgoliaRuntimeException {
217+
return this.deleteUserProfile(userID, null);
218+
}
219+
220+
/**
221+
* (asynchronously) Delete all data and predictions associated with an authenticated user (userID)
222+
* or an anonymous user (cookieID, sessionID).
223+
*
224+
* @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users
225+
* (visitors). (required)
226+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
227+
* the transporter requestOptions.
228+
* @return CompletableFuture<DeleteUserProfileResponse> The awaitable future
229+
* @throws AlgoliaRuntimeException If it fails to process the API call
230+
*/
231+
public CompletableFuture<DeleteUserProfileResponse> deleteUserProfileAsync(String userID, RequestOptions requestOptions)
232+
throws AlgoliaRuntimeException {
233+
if (userID == null) {
234+
throw new AlgoliaRuntimeException("Parameter `userID` is required when calling `deleteUserProfile`.");
235+
}
236+
237+
Object bodyObj = null;
238+
239+
// create path and map variables
240+
String requestPath = "/1/users/{userID}".replaceAll("\\{userID\\}", this.escapeString(userID.toString()));
241+
242+
Map<String, Object> queryParameters = new HashMap<String, Object>();
243+
Map<String, String> headers = new HashMap<String, String>();
244+
245+
Call call = this.buildCall(requestPath, "DELETE", queryParameters, bodyObj, headers, requestOptions, false);
246+
return this.executeAsync(call, new TypeReference<DeleteUserProfileResponse>() {});
247+
}
248+
249+
/**
250+
* (asynchronously) Delete all data and predictions associated with an authenticated user (userID)
251+
* or an anonymous user (cookieID, sessionID).
252+
*
253+
* @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users
254+
* (visitors). (required)
255+
* @return CompletableFuture<DeleteUserProfileResponse> The awaitable future
256+
* @throws AlgoliaRuntimeException If it fails to process the API call
257+
*/
258+
public CompletableFuture<DeleteUserProfileResponse> deleteUserProfileAsync(String userID) throws AlgoliaRuntimeException {
259+
return this.deleteUserProfileAsync(userID, null);
260+
}
261+
262+
/**
263+
* Get all users with predictions in the provided application.
264+
*
265+
* @param fetchAllUserProfilesParams (required)
266+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
267+
* the transporter requestOptions.
268+
* @return FetchAllUserProfilesResponse
269+
* @throws AlgoliaRuntimeException If it fails to process the API call
270+
*/
271+
public FetchAllUserProfilesResponse fetchAllUserProfiles(
272+
FetchAllUserProfilesParams fetchAllUserProfilesParams,
273+
RequestOptions requestOptions
274+
) throws AlgoliaRuntimeException {
275+
return LaunderThrowable.await(fetchAllUserProfilesAsync(fetchAllUserProfilesParams, requestOptions));
276+
}
277+
278+
/**
279+
* Get all users with predictions in the provided application.
280+
*
281+
* @param fetchAllUserProfilesParams (required)
282+
* @return FetchAllUserProfilesResponse
283+
* @throws AlgoliaRuntimeException If it fails to process the API call
284+
*/
285+
public FetchAllUserProfilesResponse fetchAllUserProfiles(FetchAllUserProfilesParams fetchAllUserProfilesParams)
286+
throws AlgoliaRuntimeException {
287+
return this.fetchAllUserProfiles(fetchAllUserProfilesParams, null);
288+
}
289+
290+
/**
291+
* (asynchronously) Get all users with predictions in the provided application.
292+
*
293+
* @param fetchAllUserProfilesParams (required)
294+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
295+
* the transporter requestOptions.
296+
* @return CompletableFuture<FetchAllUserProfilesResponse> The awaitable future
297+
* @throws AlgoliaRuntimeException If it fails to process the API call
298+
*/
299+
public CompletableFuture<FetchAllUserProfilesResponse> fetchAllUserProfilesAsync(
300+
FetchAllUserProfilesParams fetchAllUserProfilesParams,
301+
RequestOptions requestOptions
302+
) throws AlgoliaRuntimeException {
303+
if (fetchAllUserProfilesParams == null) {
304+
throw new AlgoliaRuntimeException("Parameter `fetchAllUserProfilesParams` is required when calling" + " `fetchAllUserProfiles`.");
305+
}
306+
307+
Object bodyObj = fetchAllUserProfilesParams;
308+
309+
// create path and map variables
310+
String requestPath = "/1/users";
311+
312+
Map<String, Object> queryParameters = new HashMap<String, Object>();
313+
Map<String, String> headers = new HashMap<String, String>();
314+
315+
Call call = this.buildCall(requestPath, "POST", queryParameters, bodyObj, headers, requestOptions, false);
316+
return this.executeAsync(call, new TypeReference<FetchAllUserProfilesResponse>() {});
317+
}
318+
319+
/**
320+
* (asynchronously) Get all users with predictions in the provided application.
321+
*
322+
* @param fetchAllUserProfilesParams (required)
323+
* @return CompletableFuture<FetchAllUserProfilesResponse> The awaitable future
324+
* @throws AlgoliaRuntimeException If it fails to process the API call
325+
*/
326+
public CompletableFuture<FetchAllUserProfilesResponse> fetchAllUserProfilesAsync(FetchAllUserProfilesParams fetchAllUserProfilesParams)
327+
throws AlgoliaRuntimeException {
328+
return this.fetchAllUserProfilesAsync(fetchAllUserProfilesParams, null);
329+
}
330+
192331
/**
193332
* Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a
194333
* user profile.
@@ -198,11 +337,10 @@ public CompletableFuture<Object> delAsync(String path) throws AlgoliaRuntimeExce
198337
* @param params (required)
199338
* @param requestOptions The requestOptions to send along with the query, they will be merged with
200339
* the transporter requestOptions.
201-
* @return FetchUserProfileResponse
340+
* @return UserProfile
202341
* @throws AlgoliaRuntimeException If it fails to process the API call
203342
*/
204-
public FetchUserProfileResponse fetchUserProfile(String userID, Params params, RequestOptions requestOptions)
205-
throws AlgoliaRuntimeException {
343+
public UserProfile fetchUserProfile(String userID, Params params, RequestOptions requestOptions) throws AlgoliaRuntimeException {
206344
return LaunderThrowable.await(fetchUserProfileAsync(userID, params, requestOptions));
207345
}
208346

@@ -213,10 +351,10 @@ public FetchUserProfileResponse fetchUserProfile(String userID, Params params, R
213351
* @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users
214352
* (visitors). (required)
215353
* @param params (required)
216-
* @return FetchUserProfileResponse
354+
* @return UserProfile
217355
* @throws AlgoliaRuntimeException If it fails to process the API call
218356
*/
219-
public FetchUserProfileResponse fetchUserProfile(String userID, Params params) throws AlgoliaRuntimeException {
357+
public UserProfile fetchUserProfile(String userID, Params params) throws AlgoliaRuntimeException {
220358
return this.fetchUserProfile(userID, params, null);
221359
}
222360

@@ -229,10 +367,10 @@ public FetchUserProfileResponse fetchUserProfile(String userID, Params params) t
229367
* @param params (required)
230368
* @param requestOptions The requestOptions to send along with the query, they will be merged with
231369
* the transporter requestOptions.
232-
* @return CompletableFuture<FetchUserProfileResponse> The awaitable future
370+
* @return CompletableFuture<UserProfile> The awaitable future
233371
* @throws AlgoliaRuntimeException If it fails to process the API call
234372
*/
235-
public CompletableFuture<FetchUserProfileResponse> fetchUserProfileAsync(String userID, Params params, RequestOptions requestOptions)
373+
public CompletableFuture<UserProfile> fetchUserProfileAsync(String userID, Params params, RequestOptions requestOptions)
236374
throws AlgoliaRuntimeException {
237375
if (userID == null) {
238376
throw new AlgoliaRuntimeException("Parameter `userID` is required when calling `fetchUserProfile`.");
@@ -251,7 +389,7 @@ public CompletableFuture<FetchUserProfileResponse> fetchUserProfileAsync(String
251389
Map<String, String> headers = new HashMap<String, String>();
252390

253391
Call call = this.buildCall(requestPath, "POST", queryParameters, bodyObj, headers, requestOptions, false);
254-
return this.executeAsync(call, new TypeReference<FetchUserProfileResponse>() {});
392+
return this.executeAsync(call, new TypeReference<UserProfile>() {});
255393
}
256394

257395
/**
@@ -261,10 +399,10 @@ public CompletableFuture<FetchUserProfileResponse> fetchUserProfileAsync(String
261399
* @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users
262400
* (visitors). (required)
263401
* @param params (required)
264-
* @return CompletableFuture<FetchUserProfileResponse> The awaitable future
402+
* @return CompletableFuture<UserProfile> The awaitable future
265403
* @throws AlgoliaRuntimeException If it fails to process the API call
266404
*/
267-
public CompletableFuture<FetchUserProfileResponse> fetchUserProfileAsync(String userID, Params params) throws AlgoliaRuntimeException {
405+
public CompletableFuture<UserProfile> fetchUserProfileAsync(String userID, Params params) throws AlgoliaRuntimeException {
268406
return this.fetchUserProfileAsync(userID, params, null);
269407
}
270408

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// This file is generated, manual changes will be lost - read more on
2+
// https://github.com/algolia/api-clients-automation.
3+
4+
package com.algolia.model.predict;
5+
6+
import com.fasterxml.jackson.annotation.*;
7+
import java.util.Objects;
8+
9+
/** DeleteUserProfileResponse */
10+
public class DeleteUserProfileResponse {
11+
12+
@JsonProperty("user")
13+
private String user;
14+
15+
@JsonProperty("deletedUntil")
16+
private String deletedUntil;
17+
18+
public DeleteUserProfileResponse setUser(String user) {
19+
this.user = user;
20+
return this;
21+
}
22+
23+
/**
24+
* The ID of the user that was deleted.
25+
*
26+
* @return user
27+
*/
28+
@javax.annotation.Nonnull
29+
public String getUser() {
30+
return user;
31+
}
32+
33+
public DeleteUserProfileResponse setDeletedUntil(String deletedUntil) {
34+
this.deletedUntil = deletedUntil;
35+
return this;
36+
}
37+
38+
/**
39+
* The time the same user ID will be imported again when the data is ingested.
40+
*
41+
* @return deletedUntil
42+
*/
43+
@javax.annotation.Nonnull
44+
public String getDeletedUntil() {
45+
return deletedUntil;
46+
}
47+
48+
@Override
49+
public boolean equals(Object o) {
50+
if (this == o) {
51+
return true;
52+
}
53+
if (o == null || getClass() != o.getClass()) {
54+
return false;
55+
}
56+
DeleteUserProfileResponse deleteUserProfileResponse = (DeleteUserProfileResponse) o;
57+
return (
58+
Objects.equals(this.user, deleteUserProfileResponse.user) && Objects.equals(this.deletedUntil, deleteUserProfileResponse.deletedUntil)
59+
);
60+
}
61+
62+
@Override
63+
public int hashCode() {
64+
return Objects.hash(user, deletedUntil);
65+
}
66+
67+
@Override
68+
public String toString() {
69+
StringBuilder sb = new StringBuilder();
70+
sb.append("class DeleteUserProfileResponse {\n");
71+
sb.append(" user: ").append(toIndentedString(user)).append("\n");
72+
sb.append(" deletedUntil: ").append(toIndentedString(deletedUntil)).append("\n");
73+
sb.append("}");
74+
return sb.toString();
75+
}
76+
77+
/**
78+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
79+
*/
80+
private String toIndentedString(Object o) {
81+
if (o == null) {
82+
return "null";
83+
}
84+
return o.toString().replace("\n", "\n ");
85+
}
86+
}

0 commit comments

Comments
 (0)