2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.widgets.guilds.invite;
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
import a0.a.a.b;
|
2021-06-27 20:44:35 +00:00
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.guild.Guild;
|
2021-09-01 21:26:33 +00:00
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
2021-06-27 20:44:35 +00:00
|
|
|
import com.discord.api.user.User;
|
|
|
|
import com.discord.models.domain.ModelInvite;
|
2021-07-09 21:07:36 +00:00
|
|
|
import com.discord.models.invite.InviteUtils;
|
2021-11-08 18:25:28 +00:00
|
|
|
import d0.z.d.m;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.io.Serializable;
|
2021-09-01 21:26:33 +00:00
|
|
|
import kotlin.NoWhenBranchMatchedException;
|
2021-06-27 20:44:35 +00:00
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
/* compiled from: GuildInvite.kt */
|
|
|
|
public final class GuildInvite implements Serializable {
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private final Long channelId;
|
|
|
|
private final long expirationTimeMs;
|
|
|
|
private final Long guildId;
|
2021-09-01 21:26:33 +00:00
|
|
|
private final Long guildScheduledEventId;
|
2021-06-27 20:44:35 +00:00
|
|
|
private final String inviteCode;
|
|
|
|
private final Long inviterId;
|
|
|
|
private final boolean isStaticInvite;
|
|
|
|
|
|
|
|
/* compiled from: GuildInvite.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildInvite createFromModelInvite(ModelInvite modelInvite) {
|
2021-09-01 21:26:33 +00:00
|
|
|
boolean z2;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullParameter(modelInvite, "invite");
|
2021-09-01 21:26:33 +00:00
|
|
|
GuildScheduledEvent guildScheduledEvent = modelInvite.getGuildScheduledEvent();
|
|
|
|
Long l = null;
|
|
|
|
if ((guildScheduledEvent != null ? guildScheduledEvent.b() : null) != null) {
|
|
|
|
GuildScheduledEvent guildScheduledEvent2 = modelInvite.getGuildScheduledEvent();
|
|
|
|
Long b = guildScheduledEvent2 != null ? guildScheduledEvent2.b() : null;
|
|
|
|
Channel channel = modelInvite.getChannel();
|
|
|
|
z2 = m.areEqual(b, channel != null ? Long.valueOf(channel.h()) : null);
|
|
|
|
} else {
|
|
|
|
z2 = true;
|
|
|
|
}
|
2021-09-29 00:45:08 +00:00
|
|
|
String str = modelInvite.code;
|
|
|
|
m.checkNotNullExpressionValue(str, "invite.code");
|
2021-06-27 20:44:35 +00:00
|
|
|
Guild guild = modelInvite.getGuild();
|
2021-12-17 22:03:14 +00:00
|
|
|
Long valueOf = guild != null ? Long.valueOf(guild.r()) : null;
|
2021-09-01 21:26:33 +00:00
|
|
|
Channel channel2 = modelInvite.getChannel();
|
|
|
|
Long valueOf2 = channel2 != null ? Long.valueOf(channel2.h()) : null;
|
2021-06-27 20:44:35 +00:00
|
|
|
User inviter = modelInvite.getInviter();
|
2021-09-01 21:26:33 +00:00
|
|
|
Long valueOf3 = inviter != null ? Long.valueOf(inviter.i()) : null;
|
|
|
|
boolean isStatic = modelInvite.isStatic();
|
|
|
|
long expirationTime = modelInvite.getExpirationTime();
|
|
|
|
if (z2) {
|
|
|
|
GuildScheduledEvent guildScheduledEvent3 = modelInvite.getGuildScheduledEvent();
|
|
|
|
if (guildScheduledEvent3 != null) {
|
2021-11-15 19:38:30 +00:00
|
|
|
l = Long.valueOf(guildScheduledEvent3.h());
|
2021-09-01 21:26:33 +00:00
|
|
|
}
|
|
|
|
} else if (z2) {
|
|
|
|
throw new NoWhenBranchMatchedException();
|
|
|
|
}
|
2021-09-29 00:45:08 +00:00
|
|
|
return new GuildInvite(str, valueOf, valueOf2, valueOf3, isStatic, expirationTime, l);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-01 21:26:33 +00:00
|
|
|
public GuildInvite(String str, Long l, Long l2, Long l3, boolean z2, long j, Long l4) {
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullParameter(str, "inviteCode");
|
|
|
|
this.inviteCode = str;
|
|
|
|
this.guildId = l;
|
|
|
|
this.channelId = l2;
|
|
|
|
this.inviterId = l3;
|
|
|
|
this.isStaticInvite = z2;
|
|
|
|
this.expirationTimeMs = j;
|
2021-09-01 21:26:33 +00:00
|
|
|
this.guildScheduledEventId = l4;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-09-01 21:26:33 +00:00
|
|
|
public static /* synthetic */ GuildInvite copy$default(GuildInvite guildInvite, String str, Long l, Long l2, Long l3, boolean z2, long j, Long l4, int i, Object obj) {
|
|
|
|
return guildInvite.copy((i & 1) != 0 ? guildInvite.inviteCode : str, (i & 2) != 0 ? guildInvite.guildId : l, (i & 4) != 0 ? guildInvite.channelId : l2, (i & 8) != 0 ? guildInvite.inviterId : l3, (i & 16) != 0 ? guildInvite.isStaticInvite : z2, (i & 32) != 0 ? guildInvite.expirationTimeMs : j, (i & 64) != 0 ? guildInvite.guildScheduledEventId : l4);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final String component1() {
|
|
|
|
return this.inviteCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long component2() {
|
|
|
|
return this.guildId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long component3() {
|
|
|
|
return this.channelId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long component4() {
|
|
|
|
return this.inviterId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component5() {
|
|
|
|
return this.isStaticInvite;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final long component6() {
|
|
|
|
return this.expirationTimeMs;
|
|
|
|
}
|
|
|
|
|
2021-09-01 21:26:33 +00:00
|
|
|
public final Long component7() {
|
|
|
|
return this.guildScheduledEventId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildInvite copy(String str, Long l, Long l2, Long l3, boolean z2, long j, Long l4) {
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullParameter(str, "inviteCode");
|
2021-09-01 21:26:33 +00:00
|
|
|
return new GuildInvite(str, l, l2, l3, z2, j, l4);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof GuildInvite)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
GuildInvite guildInvite = (GuildInvite) obj;
|
2021-09-01 21:26:33 +00:00
|
|
|
return m.areEqual(this.inviteCode, guildInvite.inviteCode) && m.areEqual(this.guildId, guildInvite.guildId) && m.areEqual(this.channelId, guildInvite.channelId) && m.areEqual(this.inviterId, guildInvite.inviterId) && this.isStaticInvite == guildInvite.isStaticInvite && this.expirationTimeMs == guildInvite.expirationTimeMs && m.areEqual(this.guildScheduledEventId, guildInvite.guildScheduledEventId);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Long getChannelId() {
|
|
|
|
return this.channelId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final long getExpirationTimeMs() {
|
|
|
|
return this.expirationTimeMs;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long getGuildId() {
|
|
|
|
return this.guildId;
|
|
|
|
}
|
|
|
|
|
2021-09-01 21:26:33 +00:00
|
|
|
public final Long getGuildScheduledEventId() {
|
|
|
|
return this.guildScheduledEventId;
|
|
|
|
}
|
|
|
|
|
2021-06-27 20:44:35 +00:00
|
|
|
public final String getInviteCode() {
|
|
|
|
return this.inviteCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long getInviterId() {
|
|
|
|
return this.inviterId;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public int hashCode() {
|
|
|
|
String str = this.inviteCode;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (str != null ? str.hashCode() : 0) * 31;
|
|
|
|
Long l = this.guildId;
|
|
|
|
int hashCode2 = (hashCode + (l != null ? l.hashCode() : 0)) * 31;
|
|
|
|
Long l2 = this.channelId;
|
|
|
|
int hashCode3 = (hashCode2 + (l2 != null ? l2.hashCode() : 0)) * 31;
|
|
|
|
Long l3 = this.inviterId;
|
2021-09-01 21:26:33 +00:00
|
|
|
int hashCode4 = (hashCode3 + (l3 != null ? l3.hashCode() : 0)) * 31;
|
2021-06-27 20:44:35 +00:00
|
|
|
boolean z2 = this.isStaticInvite;
|
|
|
|
if (z2) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
2021-09-01 21:26:33 +00:00
|
|
|
int i2 = z2 ? 1 : 0;
|
2021-06-27 20:44:35 +00:00
|
|
|
int i3 = z2 ? 1 : 0;
|
|
|
|
int i4 = z2 ? 1 : 0;
|
2021-09-01 21:26:33 +00:00
|
|
|
int a = (b.a(this.expirationTimeMs) + ((hashCode4 + i2) * 31)) * 31;
|
|
|
|
Long l4 = this.guildScheduledEventId;
|
|
|
|
if (l4 != null) {
|
|
|
|
i = l4.hashCode();
|
|
|
|
}
|
|
|
|
return a + i;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isStaticInvite() {
|
|
|
|
return this.isStaticInvite;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String toLink() {
|
2021-09-01 21:26:33 +00:00
|
|
|
return InviteUtils.INSTANCE.createLinkFromCode(this.inviteCode, this.guildScheduledEventId);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
2021-11-08 18:25:28 +00:00
|
|
|
StringBuilder R = a.R("GuildInvite(inviteCode=");
|
|
|
|
R.append(this.inviteCode);
|
|
|
|
R.append(", guildId=");
|
|
|
|
R.append(this.guildId);
|
|
|
|
R.append(", channelId=");
|
|
|
|
R.append(this.channelId);
|
|
|
|
R.append(", inviterId=");
|
|
|
|
R.append(this.inviterId);
|
|
|
|
R.append(", isStaticInvite=");
|
|
|
|
R.append(this.isStaticInvite);
|
|
|
|
R.append(", expirationTimeMs=");
|
|
|
|
R.append(this.expirationTimeMs);
|
|
|
|
R.append(", guildScheduledEventId=");
|
|
|
|
return a.F(R, this.guildScheduledEventId, ")");
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|