Skip to content

Commit a9c16b1

Browse files
Automatically update Java SDK
1 parent 6dd5d1f commit a9c16b1

8 files changed

Lines changed: 56 additions & 23 deletions

File tree

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- General project information -->
99
<groupId>so.trophy</groupId>
1010
<artifactId>trophy-java</artifactId>
11-
<version>1.21.1</version>
11+
<version>1.22.0</version>
1212
<packaging>jar</packaging>
1313
<name>Trophy</name>
1414
<description>Java client library for the Trophy API</description>

‎src/main/java/so/trophy/.fern/metadata.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"enable-forward-compatible-enums": false,
77
"retry-status-codes": "legacy"
88
},
9-
"originGitCommit": "48c75461f71ae06a0d8307ff0ec5152705044ab1",
9+
"originGitCommit": "95f1bf9efcd145eae90922fbd50b346f6ddb1629",
1010
"originGitCommitIsDirty": false,
1111
"invokedBy": "ci",
1212
"ciProvider": "github"

‎src/main/java/so/trophy/src/main/java/core/ClientOptions.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private ClientOptions(Environment environment, Map<String, String> headers,
3535
this.environment = environment;
3636
this.headers = new HashMap<>();
3737
this.headers.putAll(headers);
38-
this.headers.putAll(new HashMap<String,String>() {{put("X-Fern-Language", "JAVA");put("X-Fern-SDK-Name", "com.trophy.fern:api-sdk");put("X-Fern-SDK-Version", "0.0.6779");}});
38+
this.headers.putAll(new HashMap<String,String>() {{put("X-Fern-Language", "JAVA");put("X-Fern-SDK-Name", "com.trophy.fern:api-sdk");put("X-Fern-SDK-Version", "0.0.6826");}});
3939
this.headerSuppliers = headerSuppliers;
4040
this.httpClient = httpClient;
4141
this.timeout = timeout;

‎src/main/java/so/trophy/src/main/java/resources/users/AsyncRawUsersClient.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,31 +491,31 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
491491
}
492492

493493
/**
494-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
494+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
495495
*/
496496
public CompletableFuture<TrophyApiHttpResponse<UserPreferencesResponse>> updatePreferences(
497497
String id) {
498498
return updatePreferences(id,UpdateUserPreferencesRequest.builder().build());
499499
}
500500

501501
/**
502-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
502+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
503503
*/
504504
public CompletableFuture<TrophyApiHttpResponse<UserPreferencesResponse>> updatePreferences(
505505
String id, RequestOptions requestOptions) {
506506
return updatePreferences(id,UpdateUserPreferencesRequest.builder().build(),requestOptions);
507507
}
508508

509509
/**
510-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
510+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
511511
*/
512512
public CompletableFuture<TrophyApiHttpResponse<UserPreferencesResponse>> updatePreferences(
513513
String id, UpdateUserPreferencesRequest request) {
514514
return updatePreferences(id,request,null);
515515
}
516516

517517
/**
518-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
518+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
519519
*/
520520
public CompletableFuture<TrophyApiHttpResponse<UserPreferencesResponse>> updatePreferences(
521521
String id, UpdateUserPreferencesRequest request, RequestOptions requestOptions) {

‎src/main/java/so/trophy/src/main/java/resources/users/AsyncUsersClient.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,30 +151,30 @@ public CompletableFuture<UserPreferencesResponse> getPreferences(String id,
151151
}
152152

153153
/**
154-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
154+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
155155
*/
156156
public CompletableFuture<UserPreferencesResponse> updatePreferences(String id) {
157157
return this.rawClient.updatePreferences(id).thenApply(response -> response.body());
158158
}
159159

160160
/**
161-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
161+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
162162
*/
163163
public CompletableFuture<UserPreferencesResponse> updatePreferences(String id,
164164
RequestOptions requestOptions) {
165165
return this.rawClient.updatePreferences(id, requestOptions).thenApply(response -> response.body());
166166
}
167167

168168
/**
169-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
169+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
170170
*/
171171
public CompletableFuture<UserPreferencesResponse> updatePreferences(String id,
172172
UpdateUserPreferencesRequest request) {
173173
return this.rawClient.updatePreferences(id, request).thenApply(response -> response.body());
174174
}
175175

176176
/**
177-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
177+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
178178
*/
179179
public CompletableFuture<UserPreferencesResponse> updatePreferences(String id,
180180
UpdateUserPreferencesRequest request, RequestOptions requestOptions) {

‎src/main/java/so/trophy/src/main/java/resources/users/RawUsersClient.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,30 +398,30 @@ public TrophyApiHttpResponse<UserPreferencesResponse> getPreferences(String id,
398398
}
399399

400400
/**
401-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
401+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
402402
*/
403403
public TrophyApiHttpResponse<UserPreferencesResponse> updatePreferences(String id) {
404404
return updatePreferences(id,UpdateUserPreferencesRequest.builder().build());
405405
}
406406

407407
/**
408-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
408+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
409409
*/
410410
public TrophyApiHttpResponse<UserPreferencesResponse> updatePreferences(String id,
411411
RequestOptions requestOptions) {
412412
return updatePreferences(id,UpdateUserPreferencesRequest.builder().build(),requestOptions);
413413
}
414414

415415
/**
416-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
416+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
417417
*/
418418
public TrophyApiHttpResponse<UserPreferencesResponse> updatePreferences(String id,
419419
UpdateUserPreferencesRequest request) {
420420
return updatePreferences(id,request,null);
421421
}
422422

423423
/**
424-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
424+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
425425
*/
426426
public TrophyApiHttpResponse<UserPreferencesResponse> updatePreferences(String id,
427427
UpdateUserPreferencesRequest request, RequestOptions requestOptions) {

‎src/main/java/so/trophy/src/main/java/resources/users/UsersClient.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,29 +147,29 @@ public UserPreferencesResponse getPreferences(String id, RequestOptions requestO
147147
}
148148

149149
/**
150-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
150+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
151151
*/
152152
public UserPreferencesResponse updatePreferences(String id) {
153153
return this.rawClient.updatePreferences(id).body();
154154
}
155155

156156
/**
157-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
157+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
158158
*/
159159
public UserPreferencesResponse updatePreferences(String id, RequestOptions requestOptions) {
160160
return this.rawClient.updatePreferences(id, requestOptions).body();
161161
}
162162

163163
/**
164-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
164+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
165165
*/
166166
public UserPreferencesResponse updatePreferences(String id,
167167
UpdateUserPreferencesRequest request) {
168168
return this.rawClient.updatePreferences(id, request).body();
169169
}
170170

171171
/**
172-
* Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.
172+
* Update a user's notification and streak preferences. Streak preferences other than <code>streak.enabled</code> require streak customization to be enabled in your Trophy dashboard settings.
173173
*/
174174
public UserPreferencesResponse updatePreferences(String id, UpdateUserPreferencesRequest request,
175175
RequestOptions requestOptions) {

‎src/main/java/so/trophy/src/main/java/types/StreakPreferences.java‎

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
1616
import so.trophy.core.ObjectMappers;
1717
import java.lang.Boolean;
18+
import java.lang.Integer;
1819
import java.lang.Object;
1920
import java.lang.String;
2021
import java.util.HashMap;
@@ -34,14 +35,18 @@ public final class StreakPreferences {
3435

3536
private final Optional<List<StreakMetricPreference>> metrics;
3637

38+
private final Optional<List<Integer>> daysOff;
39+
3740
private final Map<String, Object> additionalProperties;
3841

3942
private StreakPreferences(Optional<Boolean> enabled,
4043
Optional<StreakEvaluationModePreference> evaluationMode,
41-
Optional<List<StreakMetricPreference>> metrics, Map<String, Object> additionalProperties) {
44+
Optional<List<StreakMetricPreference>> metrics, Optional<List<Integer>> daysOff,
45+
Map<String, Object> additionalProperties) {
4246
this.enabled = enabled;
4347
this.evaluationMode = evaluationMode;
4448
this.metrics = metrics;
49+
this.daysOff = daysOff;
4550
this.additionalProperties = additionalProperties;
4651
}
4752

@@ -66,6 +71,14 @@ public Optional<List<StreakMetricPreference>> getMetrics() {
6671
return metrics;
6772
}
6873

74+
/**
75+
* @return Days of the week that do not count toward the user's daily streak. Represented as zero-based integers matching JavaScript <code>Date.getDay()</code> (0 = Sunday, 6 = Saturday). For example, <code>[0, 6]</code> means Sunday and Saturday are days off. Only applied when streak frequency is daily. Users can still increase their streak on these days; if they do not, the streak stays paused at its current length instead of being lost.
76+
*/
77+
@JsonProperty("daysOff")
78+
public Optional<List<Integer>> getDaysOff() {
79+
return daysOff;
80+
}
81+
6982
@java.lang.Override
7083
public boolean equals(Object other) {
7184
if (this == other) return true;
@@ -78,12 +91,12 @@ public Map<String, Object> getAdditionalProperties() {
7891
}
7992

8093
private boolean equalTo(StreakPreferences other) {
81-
return enabled.equals(other.enabled) && evaluationMode.equals(other.evaluationMode) && metrics.equals(other.metrics);
94+
return enabled.equals(other.enabled) && evaluationMode.equals(other.evaluationMode) && metrics.equals(other.metrics) && daysOff.equals(other.daysOff);
8295
}
8396

8497
@java.lang.Override
8598
public int hashCode() {
86-
return Objects.hash(this.enabled, this.evaluationMode, this.metrics);
99+
return Objects.hash(this.enabled, this.evaluationMode, this.metrics, this.daysOff);
87100
}
88101

89102
@java.lang.Override
@@ -105,6 +118,8 @@ public static final class Builder {
105118

106119
private Optional<List<StreakMetricPreference>> metrics = Optional.empty();
107120

121+
private Optional<List<Integer>> daysOff = Optional.empty();
122+
108123
@JsonAnySetter
109124
private Map<String, Object> additionalProperties = new HashMap<>();
110125

@@ -115,6 +130,7 @@ public Builder from(StreakPreferences other) {
115130
enabled(other.getEnabled());
116131
evaluationMode(other.getEvaluationMode());
117132
metrics(other.getMetrics());
133+
daysOff(other.getDaysOff());
118134
return this;
119135
}
120136

@@ -166,8 +182,25 @@ public Builder metrics(List<StreakMetricPreference> metrics) {
166182
return this;
167183
}
168184

185+
/**
186+
* <p>Days of the week that do not count toward the user's daily streak. Represented as zero-based integers matching JavaScript <code>Date.getDay()</code> (0 = Sunday, 6 = Saturday). For example, <code>[0, 6]</code> means Sunday and Saturday are days off. Only applied when streak frequency is daily. Users can still increase their streak on these days; if they do not, the streak stays paused at its current length instead of being lost.</p>
187+
*/
188+
@JsonSetter(
189+
value = "daysOff",
190+
nulls = Nulls.SKIP
191+
)
192+
public Builder daysOff(Optional<List<Integer>> daysOff) {
193+
this.daysOff = daysOff;
194+
return this;
195+
}
196+
197+
public Builder daysOff(List<Integer> daysOff) {
198+
this.daysOff = Optional.ofNullable(daysOff);
199+
return this;
200+
}
201+
169202
public StreakPreferences build() {
170-
return new StreakPreferences(enabled, evaluationMode, metrics, additionalProperties);
203+
return new StreakPreferences(enabled, evaluationMode, metrics, daysOff, additionalProperties);
171204
}
172205

173206
public Builder additionalProperty(String key, Object value) {

0 commit comments

Comments
 (0)