Skip to content

Commit 9b9c03b

Browse files
Release 1.8.39
1 parent 0c46450 commit 9b9c03b

22 files changed

Lines changed: 874 additions & 306 deletions

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ java {
4646

4747
group = 'com.flagright.api'
4848

49-
version = '1.8.38'
49+
version = '1.8.39'
5050

5151
jar {
5252
dependsOn(":generatePomFileForMavenPublication")
@@ -77,7 +77,7 @@ publishing {
7777
maven(MavenPublication) {
7878
groupId = 'com.flagright.api'
7979
artifactId = 'flagright-java'
80-
version = '1.8.38'
80+
version = '1.8.39'
8181
from components.java
8282
pom {
8383
name = 'flagright'

src/main/java/com/flagright/api/AsyncFlagrightBuilder.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public final class AsyncFlagrightBuilder {
1212

1313
private String apiKey = null;
1414

15+
private String authorization = null;
16+
1517
private Environment environment = Environment.SANDBOX_API_SERVER_EU_1;
1618

1719
/**
@@ -22,6 +24,14 @@ public AsyncFlagrightBuilder apiKey(String apiKey) {
2224
return this;
2325
}
2426

27+
/**
28+
* Sets authorization
29+
*/
30+
public AsyncFlagrightBuilder authorization(String authorization) {
31+
this.authorization = authorization;
32+
return this;
33+
}
34+
2535
public AsyncFlagrightBuilder environment(Environment environment) {
2636
this.environment = environment;
2737
return this;
@@ -61,6 +71,10 @@ public AsyncFlagright build() {
6171
throw new RuntimeException("Please provide apiKey");
6272
}
6373
this.clientOptionsBuilder.addHeader("x-api-key", this.apiKey);
74+
if (authorization == null) {
75+
throw new RuntimeException("Please provide authorization");
76+
}
77+
this.clientOptionsBuilder.addHeader("Authorization", this.authorization);
6478
clientOptionsBuilder.environment(this.environment);
6579
return new AsyncFlagright(clientOptionsBuilder.build());
6680
}

src/main/java/com/flagright/api/FlagrightBuilder.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public final class FlagrightBuilder {
1212

1313
private String apiKey = null;
1414

15+
private String authorization = null;
16+
1517
private Environment environment = Environment.SANDBOX_API_SERVER_EU_1;
1618

1719
/**
@@ -22,6 +24,14 @@ public FlagrightBuilder apiKey(String apiKey) {
2224
return this;
2325
}
2426

27+
/**
28+
* Sets authorization
29+
*/
30+
public FlagrightBuilder authorization(String authorization) {
31+
this.authorization = authorization;
32+
return this;
33+
}
34+
2535
public FlagrightBuilder environment(Environment environment) {
2636
this.environment = environment;
2737
return this;
@@ -61,6 +71,10 @@ public Flagright build() {
6171
throw new RuntimeException("Please provide apiKey");
6272
}
6373
this.clientOptionsBuilder.addHeader("x-api-key", this.apiKey);
74+
if (authorization == null) {
75+
throw new RuntimeException("Please provide authorization");
76+
}
77+
this.clientOptionsBuilder.addHeader("Authorization", this.authorization);
6478
clientOptionsBuilder.environment(this.environment);
6579
return new Flagright(clientOptionsBuilder.build());
6680
}

src/main/java/com/flagright/api/core/ClientOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ private ClientOptions(
3232
this.headers.putAll(headers);
3333
this.headers.putAll(new HashMap<String, String>() {
3434
{
35-
put("User-Agent", "com.flagright.api:flagright-java/1.8.38");
35+
put("User-Agent", "com.flagright.api:flagright-java/1.8.39");
3636
put("X-Fern-Language", "JAVA");
3737
put("X-Fern-SDK-Name", "com.flagright.fern:api-sdk");
38-
put("X-Fern-SDK-Version", "1.8.38");
38+
put("X-Fern-SDK-Version", "1.8.39");
3939
}
4040
});
4141
this.headerSuppliers = headerSuppliers;

src/main/java/com/flagright/api/core/RequestOptions.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
public final class RequestOptions {
1313
private final String apiKey;
1414

15+
private final String authorization;
16+
1517
private final Optional<Integer> timeout;
1618

1719
private final TimeUnit timeoutTimeUnit;
@@ -22,11 +24,13 @@ public final class RequestOptions {
2224

2325
private RequestOptions(
2426
String apiKey,
27+
String authorization,
2528
Optional<Integer> timeout,
2629
TimeUnit timeoutTimeUnit,
2730
Map<String, String> headers,
2831
Map<String, Supplier<String>> headerSuppliers) {
2932
this.apiKey = apiKey;
33+
this.authorization = authorization;
3034
this.timeout = timeout;
3135
this.timeoutTimeUnit = timeoutTimeUnit;
3236
this.headers = headers;
@@ -46,6 +50,9 @@ public Map<String, String> getHeaders() {
4650
if (this.apiKey != null) {
4751
headers.put("x-api-key", this.apiKey);
4852
}
53+
if (this.authorization != null) {
54+
headers.put("Authorization", this.authorization);
55+
}
4956
headers.putAll(this.headers);
5057
this.headerSuppliers.forEach((key, supplier) -> {
5158
headers.put(key, supplier.get());
@@ -60,6 +67,8 @@ public static Builder builder() {
6067
public static final class Builder {
6168
private String apiKey = null;
6269

70+
private String authorization = null;
71+
6372
private Optional<Integer> timeout = Optional.empty();
6473

6574
private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS;
@@ -73,6 +82,11 @@ public Builder apiKey(String apiKey) {
7382
return this;
7483
}
7584

85+
public Builder authorization(String authorization) {
86+
this.authorization = authorization;
87+
return this;
88+
}
89+
7690
public Builder timeout(Integer timeout) {
7791
this.timeout = Optional.of(timeout);
7892
return this;
@@ -95,7 +109,7 @@ public Builder addHeader(String key, Supplier<String> value) {
95109
}
96110

97111
public RequestOptions build() {
98-
return new RequestOptions(apiKey, timeout, timeoutTimeUnit, headers, headerSuppliers);
112+
return new RequestOptions(apiKey, authorization, timeout, timeoutTimeUnit, headers, headerSuppliers);
99113
}
100114
}
101115
}

src/main/java/com/flagright/api/resources/batch/AsyncBatchClient.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ public CompletableFuture<BatchConsumerUsersWithRulesResult> getConsumerUsers(
114114
return this.rawClient.getConsumerUsers(batchId, request, requestOptions).thenApply(response -> response.body());
115115
}
116116

117+
public CompletableFuture<BatchResponse> createBusinessUsers(BusinessBatchRequest request) {
118+
return this.rawClient.createBusinessUsers(request).thenApply(response -> response.body());
119+
}
120+
121+
public CompletableFuture<BatchResponse> createBusinessUsers(
122+
BusinessBatchRequest request, RequestOptions requestOptions) {
123+
return this.rawClient.createBusinessUsers(request, requestOptions).thenApply(response -> response.body());
124+
}
125+
117126
public CompletableFuture<BatchBusinessUsersWithRulesResults> getBusinessUsers(String batchId) {
118127
return this.rawClient.getBusinessUsers(batchId).thenApply(response -> response.body());
119128
}
@@ -128,13 +137,13 @@ public CompletableFuture<BatchBusinessUsersWithRulesResults> getBusinessUsers(
128137
return this.rawClient.getBusinessUsers(batchId, request, requestOptions).thenApply(response -> response.body());
129138
}
130139

131-
public CompletableFuture<BatchResponse> createBusinessUsers(BusinessBatchRequest request) {
132-
return this.rawClient.createBusinessUsers(request).thenApply(response -> response.body());
140+
public CompletableFuture<BatchResponse> createConsumerUserEvents(ConsumerUserEventBatchRequest request) {
141+
return this.rawClient.createConsumerUserEvents(request).thenApply(response -> response.body());
133142
}
134143

135-
public CompletableFuture<BatchResponse> createBusinessUsers(
136-
BusinessBatchRequest request, RequestOptions requestOptions) {
137-
return this.rawClient.createBusinessUsers(request, requestOptions).thenApply(response -> response.body());
144+
public CompletableFuture<BatchResponse> createConsumerUserEvents(
145+
ConsumerUserEventBatchRequest request, RequestOptions requestOptions) {
146+
return this.rawClient.createConsumerUserEvents(request, requestOptions).thenApply(response -> response.body());
138147
}
139148

140149
public CompletableFuture<BatchConsumerUserEventsRulesResult> getConsumerUserEvents(String batchId) {
@@ -153,6 +162,15 @@ public CompletableFuture<BatchConsumerUserEventsRulesResult> getConsumerUserEven
153162
.thenApply(response -> response.body());
154163
}
155164

165+
public CompletableFuture<BatchResponse> createBusinessUserEvents(BusinessUserEventBatchRequest request) {
166+
return this.rawClient.createBusinessUserEvents(request).thenApply(response -> response.body());
167+
}
168+
169+
public CompletableFuture<BatchResponse> createBusinessUserEvents(
170+
BusinessUserEventBatchRequest request, RequestOptions requestOptions) {
171+
return this.rawClient.createBusinessUserEvents(request, requestOptions).thenApply(response -> response.body());
172+
}
173+
156174
public CompletableFuture<BatchBusinessUserEventsWithRulesResult> getBusinessUserEvents(String batchId) {
157175
return this.rawClient.getBusinessUserEvents(batchId).thenApply(response -> response.body());
158176
}
@@ -168,22 +186,4 @@ public CompletableFuture<BatchBusinessUserEventsWithRulesResult> getBusinessUser
168186
.getBusinessUserEvents(batchId, request, requestOptions)
169187
.thenApply(response -> response.body());
170188
}
171-
172-
public CompletableFuture<BatchResponse> createConsumerUserEvents(ConsumerUserEventBatchRequest request) {
173-
return this.rawClient.createConsumerUserEvents(request).thenApply(response -> response.body());
174-
}
175-
176-
public CompletableFuture<BatchResponse> createConsumerUserEvents(
177-
ConsumerUserEventBatchRequest request, RequestOptions requestOptions) {
178-
return this.rawClient.createConsumerUserEvents(request, requestOptions).thenApply(response -> response.body());
179-
}
180-
181-
public CompletableFuture<BatchResponse> createBusinessUserEvents(BusinessUserEventBatchRequest request) {
182-
return this.rawClient.createBusinessUserEvents(request).thenApply(response -> response.body());
183-
}
184-
185-
public CompletableFuture<BatchResponse> createBusinessUserEvents(
186-
BusinessUserEventBatchRequest request, RequestOptions requestOptions) {
187-
return this.rawClient.createBusinessUserEvents(request, requestOptions).thenApply(response -> response.body());
188-
}
189189
}

0 commit comments

Comments
 (0)