package com.discord.models.domain; import c.d.b.a.a; import com.discord.api.premium.SubscriptionPlan; import com.discord.api.user.User; import com.discord.models.domain.ModelSku; import com.discord.utilities.time.TimeUtils; import d0.z.d.m; /* compiled from: ModelGift.kt */ public final class ModelGift { private final String code; private final String expiresAt; private final Integer giftStyle; private final int maxUses; private final boolean redeemed; private final long skuId; private final ModelStoreListing storeListing; private final SubscriptionPlan subscriptionPlan; private final Long subscriptionPlanId; private final User user; private final int uses; public ModelGift(long j, boolean z2, String str, String str2, int i, ModelStoreListing modelStoreListing, int i2, User user, Long l, SubscriptionPlan subscriptionPlan, Integer num) { m.checkNotNullParameter(str2, ModelAuditLogEntry.CHANGE_KEY_CODE); this.skuId = j; this.redeemed = z2; this.expiresAt = str; this.code = str2; this.uses = i; this.storeListing = modelStoreListing; this.maxUses = i2; this.user = user; this.subscriptionPlanId = l; this.subscriptionPlan = subscriptionPlan; this.giftStyle = num; } public static /* synthetic */ ModelGift copy$default(ModelGift modelGift, long j, boolean z2, String str, String str2, int i, ModelStoreListing modelStoreListing, int i2, User user, Long l, SubscriptionPlan subscriptionPlan, Integer num, int i3, Object obj) { return modelGift.copy((i3 & 1) != 0 ? modelGift.skuId : j, (i3 & 2) != 0 ? modelGift.redeemed : z2, (i3 & 4) != 0 ? modelGift.expiresAt : str, (i3 & 8) != 0 ? modelGift.code : str2, (i3 & 16) != 0 ? modelGift.uses : i, (i3 & 32) != 0 ? modelGift.storeListing : modelStoreListing, (i3 & 64) != 0 ? modelGift.maxUses : i2, (i3 & 128) != 0 ? modelGift.user : user, (i3 & 256) != 0 ? modelGift.subscriptionPlanId : l, (i3 & 512) != 0 ? modelGift.subscriptionPlan : subscriptionPlan, (i3 & 1024) != 0 ? modelGift.giftStyle : num); } public final long component1() { return this.skuId; } public final SubscriptionPlan component10() { return this.subscriptionPlan; } public final Integer component11() { return this.giftStyle; } public final boolean component2() { return this.redeemed; } public final String component3() { return this.expiresAt; } public final String component4() { return this.code; } public final int component5() { return this.uses; } public final ModelStoreListing component6() { return this.storeListing; } public final int component7() { return this.maxUses; } public final User component8() { return this.user; } public final Long component9() { return this.subscriptionPlanId; } public final ModelGift copy(long j, boolean z2, String str, String str2, int i, ModelStoreListing modelStoreListing, int i2, User user, Long l, SubscriptionPlan subscriptionPlan, Integer num) { m.checkNotNullParameter(str2, ModelAuditLogEntry.CHANGE_KEY_CODE); return new ModelGift(j, z2, str, str2, i, modelStoreListing, i2, user, l, subscriptionPlan, num); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ModelGift)) { return false; } ModelGift modelGift = (ModelGift) obj; return this.skuId == modelGift.skuId && this.redeemed == modelGift.redeemed && m.areEqual(this.expiresAt, modelGift.expiresAt) && m.areEqual(this.code, modelGift.code) && this.uses == modelGift.uses && m.areEqual(this.storeListing, modelGift.storeListing) && this.maxUses == modelGift.maxUses && m.areEqual(this.user, modelGift.user) && m.areEqual(this.subscriptionPlanId, modelGift.subscriptionPlanId) && m.areEqual(this.subscriptionPlan, modelGift.subscriptionPlan) && m.areEqual(this.giftStyle, modelGift.giftStyle); } public final String getCode() { return this.code; } public final String getExpiresAt() { return this.expiresAt; } public final long getExpiresDiff(long j) { String str = this.expiresAt; if (str != null) { return TimeUtils.parseUTCDate(str) - j; } return 0; } public final Integer getGiftStyle() { return this.giftStyle; } public final int getMaxUses() { return this.maxUses; } public final boolean getRedeemed() { return this.redeemed; } public final long getSkuId() { return this.skuId; } public final ModelStoreListing getStoreListing() { return this.storeListing; } public final SubscriptionPlan getSubscriptionPlan() { return this.subscriptionPlan; } public final Long getSubscriptionPlanId() { return this.subscriptionPlanId; } public final User getUser() { return this.user; } public final int getUses() { return this.uses; } public int hashCode() { long j = this.skuId; int i = ((int) (j ^ (j >>> 32))) * 31; boolean z2 = this.redeemed; if (z2) { z2 = true; } int i2 = z2 ? 1 : 0; int i3 = z2 ? 1 : 0; int i4 = z2 ? 1 : 0; int i5 = (i + i2) * 31; String str = this.expiresAt; int i6 = 0; int hashCode = (i5 + (str != null ? str.hashCode() : 0)) * 31; String str2 = this.code; int hashCode2 = (((hashCode + (str2 != null ? str2.hashCode() : 0)) * 31) + this.uses) * 31; ModelStoreListing modelStoreListing = this.storeListing; int hashCode3 = (((hashCode2 + (modelStoreListing != null ? modelStoreListing.hashCode() : 0)) * 31) + this.maxUses) * 31; User user = this.user; int hashCode4 = (hashCode3 + (user != null ? user.hashCode() : 0)) * 31; Long l = this.subscriptionPlanId; int hashCode5 = (hashCode4 + (l != null ? l.hashCode() : 0)) * 31; SubscriptionPlan subscriptionPlan = this.subscriptionPlan; int hashCode6 = (hashCode5 + (subscriptionPlan != null ? subscriptionPlan.hashCode() : 0)) * 31; Integer num = this.giftStyle; if (num != null) { i6 = num.hashCode(); } return hashCode6 + i6; } public final boolean isAnyNitroGift() { return isNitroGift() || isNitroClassicGift(); } public final boolean isClaimedByMe() { return this.redeemed; } public final boolean isComplete() { return this.storeListing != null; } public final boolean isExpired(long j) { String str = this.expiresAt; return str != null && j > TimeUtils.parseUTCDate(str); } public final boolean isNitroClassicGift() { ModelSku sku; ModelStoreListing modelStoreListing = this.storeListing; return ((modelStoreListing == null || (sku = modelStoreListing.getSku()) == null) ? null : sku.getSkuCategory()) == ModelSku.SkuCategory.NITRO_CLASSIC; } public final boolean isNitroGift() { ModelSku sku; ModelStoreListing modelStoreListing = this.storeListing; return ((modelStoreListing == null || (sku = modelStoreListing.getSku()) == null) ? null : sku.getSkuCategory()) == ModelSku.SkuCategory.NITRO; } public String toString() { StringBuilder R = a.R("ModelGift(skuId="); R.append(this.skuId); R.append(", redeemed="); R.append(this.redeemed); R.append(", expiresAt="); R.append(this.expiresAt); R.append(", code="); R.append(this.code); R.append(", uses="); R.append(this.uses); R.append(", storeListing="); R.append(this.storeListing); R.append(", maxUses="); R.append(this.maxUses); R.append(", user="); R.append(this.user); R.append(", subscriptionPlanId="); R.append(this.subscriptionPlanId); R.append(", subscriptionPlan="); R.append(this.subscriptionPlan); R.append(", giftStyle="); return a.E(R, this.giftStyle, ")"); } }