Skip to content

Commit

Permalink
Release 0.034
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Nov 10, 2022
1 parent d9332da commit 5a7c9c2
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 180 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ publishing {
maven(MavenPublication) {
groupId = 'dev.ravenapp'
artifactId = 'raven-java'
version = '0.0.33'
version = '0.034'
from components.java
}
}
Expand Down
191 changes: 186 additions & 5 deletions src/main/java/com/raven/api/client/event/types/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.raven.api.client.user.types.InAppProfile;
import com.raven.api.client.user.types.SlackProfile;
import com.raven.api.client.user.types.TelegramProfile;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
Expand All @@ -26,19 +29,43 @@ public final class User {

private final Optional<String> onesignalExternalId;

private final Optional<List<String>> onesignalPlayerIds;

private final Optional<List<String>> fcmTokens;

private final Optional<List<String>> iosTokens;

private final Optional<SlackProfile> slack;

private final Optional<TelegramProfile> telegram;

private final Optional<String> fcmTopic;

private final Optional<String> fcmDeviceGroup;

private final Optional<InAppProfile> inApp;

private int _cachedHashCode;

User(Optional<String> userId, Optional<String> email, Optional<String> mobile,
Optional<String> whatsappMobile, Optional<String> onesignalExternalId,
Optional<List<String>> fcmTokens) {
Optional<List<String>> onesignalPlayerIds, Optional<List<String>> fcmTokens,
Optional<List<String>> iosTokens, Optional<SlackProfile> slack,
Optional<TelegramProfile> telegram, Optional<String> fcmTopic,
Optional<String> fcmDeviceGroup, Optional<InAppProfile> inApp) {
this.userId = userId;
this.email = email;
this.mobile = mobile;
this.whatsappMobile = whatsappMobile;
this.onesignalExternalId = onesignalExternalId;
this.onesignalPlayerIds = onesignalPlayerIds;
this.fcmTokens = fcmTokens;
this.iosTokens = iosTokens;
this.slack = slack;
this.telegram = telegram;
this.fcmTopic = fcmTopic;
this.fcmDeviceGroup = fcmDeviceGroup;
this.inApp = inApp;
}

@JsonProperty("user_id")
Expand Down Expand Up @@ -66,32 +93,67 @@ public Optional<String> getOnesignalExternalId() {
return onesignalExternalId;
}

@JsonProperty("onesignal_player_ids")
public Optional<List<String>> getOnesignalPlayerIds() {
return onesignalPlayerIds;
}

@JsonProperty("fcm_tokens")
public Optional<List<String>> getFcmTokens() {
return fcmTokens;
}

@JsonProperty("ios_tokens")
public Optional<List<String>> getIosTokens() {
return iosTokens;
}

@JsonProperty("slack")
public Optional<SlackProfile> getSlack() {
return slack;
}

@JsonProperty("telegram")
public Optional<TelegramProfile> getTelegram() {
return telegram;
}

@JsonProperty("fcm_topic")
public Optional<String> getFcmTopic() {
return fcmTopic;
}

@JsonProperty("fcm_device_group")
public Optional<String> getFcmDeviceGroup() {
return fcmDeviceGroup;
}

@JsonProperty("in_app")
public Optional<InAppProfile> getInApp() {
return inApp;
}

@Override
public boolean equals(Object other) {
if (this == other) return true;
return other instanceof User && equalTo((User) other);
}

private boolean equalTo(User other) {
return userId.equals(other.userId) && email.equals(other.email) && mobile.equals(other.mobile) && whatsappMobile.equals(other.whatsappMobile) && onesignalExternalId.equals(other.onesignalExternalId) && fcmTokens.equals(other.fcmTokens);
return userId.equals(other.userId) && email.equals(other.email) && mobile.equals(other.mobile) && whatsappMobile.equals(other.whatsappMobile) && onesignalExternalId.equals(other.onesignalExternalId) && onesignalPlayerIds.equals(other.onesignalPlayerIds) && fcmTokens.equals(other.fcmTokens) && iosTokens.equals(other.iosTokens) && slack.equals(other.slack) && telegram.equals(other.telegram) && fcmTopic.equals(other.fcmTopic) && fcmDeviceGroup.equals(other.fcmDeviceGroup) && inApp.equals(other.inApp);
}

@Override
public int hashCode() {
if (_cachedHashCode == 0) {
_cachedHashCode = Objects.hash(this.userId, this.email, this.mobile, this.whatsappMobile, this.onesignalExternalId, this.fcmTokens);
_cachedHashCode = Objects.hash(this.userId, this.email, this.mobile, this.whatsappMobile, this.onesignalExternalId, this.onesignalPlayerIds, this.fcmTokens, this.iosTokens, this.slack, this.telegram, this.fcmTopic, this.fcmDeviceGroup, this.inApp);
}
return _cachedHashCode;
}

@Override
public String toString() {
return "User{" + "userId: " + userId + ", email: " + email + ", mobile: " + mobile + ", whatsappMobile: " + whatsappMobile + ", onesignalExternalId: " + onesignalExternalId + ", fcmTokens: " + fcmTokens + "}";
return "User{" + "userId: " + userId + ", email: " + email + ", mobile: " + mobile + ", whatsappMobile: " + whatsappMobile + ", onesignalExternalId: " + onesignalExternalId + ", onesignalPlayerIds: " + onesignalPlayerIds + ", fcmTokens: " + fcmTokens + ", iosTokens: " + iosTokens + ", slack: " + slack + ", telegram: " + telegram + ", fcmTopic: " + fcmTopic + ", fcmDeviceGroup: " + fcmDeviceGroup + ", inApp: " + inApp + "}";
}

public static Builder builder() {
Expand All @@ -112,8 +174,22 @@ public static final class Builder {

private Optional<String> onesignalExternalId = Optional.empty();

private Optional<List<String>> onesignalPlayerIds = Optional.empty();

private Optional<List<String>> fcmTokens = Optional.empty();

private Optional<List<String>> iosTokens = Optional.empty();

private Optional<SlackProfile> slack = Optional.empty();

private Optional<TelegramProfile> telegram = Optional.empty();

private Optional<String> fcmTopic = Optional.empty();

private Optional<String> fcmDeviceGroup = Optional.empty();

private Optional<InAppProfile> inApp = Optional.empty();

private Builder() {
}

Expand All @@ -123,7 +199,14 @@ public Builder from(User other) {
mobile(other.getMobile());
whatsappMobile(other.getWhatsappMobile());
onesignalExternalId(other.getOnesignalExternalId());
onesignalPlayerIds(other.getOnesignalPlayerIds());
fcmTokens(other.getFcmTokens());
iosTokens(other.getIosTokens());
slack(other.getSlack());
telegram(other.getTelegram());
fcmTopic(other.getFcmTopic());
fcmDeviceGroup(other.getFcmDeviceGroup());
inApp(other.getInApp());
return this;
}

Expand Down Expand Up @@ -197,6 +280,20 @@ public Builder onesignalExternalId(String onesignalExternalId) {
return this;
}

@JsonSetter(
value = "onesignal_player_ids",
nulls = Nulls.SKIP
)
public Builder onesignalPlayerIds(Optional<List<String>> onesignalPlayerIds) {
this.onesignalPlayerIds = onesignalPlayerIds;
return this;
}

public Builder onesignalPlayerIds(List<String> onesignalPlayerIds) {
this.onesignalPlayerIds = Optional.of(onesignalPlayerIds);
return this;
}

@JsonSetter(
value = "fcm_tokens",
nulls = Nulls.SKIP
Expand All @@ -211,8 +308,92 @@ public Builder fcmTokens(List<String> fcmTokens) {
return this;
}

@JsonSetter(
value = "ios_tokens",
nulls = Nulls.SKIP
)
public Builder iosTokens(Optional<List<String>> iosTokens) {
this.iosTokens = iosTokens;
return this;
}

public Builder iosTokens(List<String> iosTokens) {
this.iosTokens = Optional.of(iosTokens);
return this;
}

@JsonSetter(
value = "slack",
nulls = Nulls.SKIP
)
public Builder slack(Optional<SlackProfile> slack) {
this.slack = slack;
return this;
}

public Builder slack(SlackProfile slack) {
this.slack = Optional.of(slack);
return this;
}

@JsonSetter(
value = "telegram",
nulls = Nulls.SKIP
)
public Builder telegram(Optional<TelegramProfile> telegram) {
this.telegram = telegram;
return this;
}

public Builder telegram(TelegramProfile telegram) {
this.telegram = Optional.of(telegram);
return this;
}

@JsonSetter(
value = "fcm_topic",
nulls = Nulls.SKIP
)
public Builder fcmTopic(Optional<String> fcmTopic) {
this.fcmTopic = fcmTopic;
return this;
}

public Builder fcmTopic(String fcmTopic) {
this.fcmTopic = Optional.of(fcmTopic);
return this;
}

@JsonSetter(
value = "fcm_device_group",
nulls = Nulls.SKIP
)
public Builder fcmDeviceGroup(Optional<String> fcmDeviceGroup) {
this.fcmDeviceGroup = fcmDeviceGroup;
return this;
}

public Builder fcmDeviceGroup(String fcmDeviceGroup) {
this.fcmDeviceGroup = Optional.of(fcmDeviceGroup);
return this;
}

@JsonSetter(
value = "in_app",
nulls = Nulls.SKIP
)
public Builder inApp(Optional<InAppProfile> inApp) {
this.inApp = inApp;
return this;
}

public Builder inApp(InAppProfile inApp) {
this.inApp = Optional.of(inApp);
return this;
}

public User build() {
return new User(userId, email, mobile, whatsappMobile, onesignalExternalId, fcmTokens);
return new User(userId, email, mobile, whatsappMobile, onesignalExternalId, onesignalPlayerIds, fcmTokens, iosTokens, slack, telegram, fcmTopic, fcmDeviceGroup, inApp);
}
}
}
Loading

0 comments on commit 5a7c9c2

Please sign in to comment.