Skip to content

Commit 7f1cde3

Browse files
committed
Release 0.0.42
1 parent f93f383 commit 7f1cde3

2 files changed

Lines changed: 15 additions & 29 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ publishing {
3636
maven(MavenPublication) {
3737
groupId = 'dev.ravenapp'
3838
artifactId = 'raven-java'
39-
version = '0.0.41'
39+
version = '0.0.42'
4040
from components.java
4141
}
4242
}

src/main/java/com/raven/api/RavenApiClient.java

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,43 @@
11
package com.raven.api;
22

33
import com.raven.api.client.Authorization;
4-
import com.raven.api.client.device.DeviceServiceClient;
5-
import com.raven.api.client.event.EventServiceClient;
6-
import com.raven.api.client.event.endpoints.Send;
7-
import com.raven.api.client.event.endpoints.SendBulk;
8-
import com.raven.api.client.event.exceptions.SendBulkException;
9-
import com.raven.api.client.event.exceptions.SendException;
10-
import com.raven.api.client.event.types.SendEventResponse;
11-
import com.raven.api.client.user.UserServiceClient;
4+
import com.raven.api.client.ServiceClient;
5+
import com.raven.api.client.device.deviceServiceClient;
6+
import com.raven.api.client.user.userServiceClient;
127
import com.raven.api.core.Environment;
13-
import java.lang.String;
148
import java.util.Objects;
159
import java.util.concurrent.atomic.AtomicReference;
1610
import java.util.function.Supplier;
1711

1812
public final class RavenApiClient {
19-
private final Supplier<DeviceServiceClient> deviceServiceClient;
13+
private final Supplier<ServiceClient> serviceClient;
2014

21-
private final Supplier<EventServiceClient> eventServiceClient;
15+
private final Supplier<deviceServiceClient> deviceServiceClient;
2216

23-
private final Supplier<UserServiceClient> userServiceClient;
17+
private final Supplier<userServiceClient> userServiceClient;
2418

2519
public RavenApiClient(Authorization auth) {
2620
this(Environment.PROD, auth);
2721
}
2822

2923
public RavenApiClient(Environment environment, Authorization auth) {
30-
this.userServiceClient = memoize(() -> new UserServiceClient(environment.getUrl(), auth));
31-
this.eventServiceClient = memoize(() -> new EventServiceClient(environment.getUrl(), auth));
32-
this.deviceServiceClient = memoize(() -> new DeviceServiceClient(environment.getUrl(), auth));
24+
this.userServiceClient = memoize(() -> new userServiceClient(environment.getUrl(), auth));
25+
this.serviceClient = memoize(() -> new ServiceClient(environment.getUrl(), auth));
26+
this.deviceServiceClient = memoize(() -> new deviceServiceClient(environment.getUrl(), auth));
3327
}
3428

35-
public final DeviceServiceClient device() {
36-
return this.deviceServiceClient.get();
29+
public final ServiceClient service() {
30+
return this.serviceClient.get();
3731
}
3832

39-
public final EventServiceClient event() {
40-
return this.eventServiceClient.get();
33+
public final deviceServiceClient device() {
34+
return this.deviceServiceClient.get();
4135
}
4236

43-
public final UserServiceClient user() {
37+
public final userServiceClient user() {
4438
return this.userServiceClient.get();
4539
}
4640

47-
public SendEventResponse send(Send.Request request) throws SendException {
48-
return event().send(request);
49-
}
50-
51-
public SendEventResponse sendBulk(SendBulk.Request request) throws SendBulkException {
52-
return event().sendBulk(request);
53-
}
54-
5541
private static <T> Supplier<T> memoize(Supplier<T> delegate) {
5642
AtomicReference<T> value = new AtomicReference<>();
5743
return () -> {

0 commit comments

Comments
 (0)