Skip to content

Commit

Permalink
Make DiscordPoll.results optional
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Sep 2, 2024
1 parent a58879b commit 3efd971
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -5293,22 +5293,23 @@ public final class dev/kord/common/entity/DiscordPinsUpdateData$Companion {

public final class dev/kord/common/entity/DiscordPoll {
public static final field Companion Ldev/kord/common/entity/DiscordPoll$Companion;
public fun <init> (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;)V
public fun <init> (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/optional/Optional;)V
public synthetic fun <init> (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ldev/kord/common/entity/DiscordPoll$Media;
public final fun component2 ()Ljava/util/List;
public final fun component3 ()Lkotlinx/datetime/Instant;
public final fun component4 ()Z
public final fun component5 ()Ldev/kord/common/entity/PollLayoutType;
public final fun component6 ()Ldev/kord/common/entity/DiscordPoll$Results;
public final fun copy (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;)Ldev/kord/common/entity/DiscordPoll;
public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll;Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/DiscordPoll$Results;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll;
public final fun component6 ()Ldev/kord/common/entity/optional/Optional;
public final fun copy (Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordPoll;
public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPoll;Ldev/kord/common/entity/DiscordPoll$Media;Ljava/util/List;Lkotlinx/datetime/Instant;ZLdev/kord/common/entity/PollLayoutType;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPoll;
public fun equals (Ljava/lang/Object;)Z
public final fun getAllowMultiselect ()Z
public final fun getAnswers ()Ljava/util/List;
public final fun getExpiry ()Lkotlinx/datetime/Instant;
public final fun getLayoutType ()Ldev/kord/common/entity/PollLayoutType;
public final fun getQuestion ()Ldev/kord/common/entity/DiscordPoll$Media;
public final fun getResults ()Ldev/kord/common/entity/DiscordPoll$Results;
public final fun getResults ()Ldev/kord/common/entity/optional/Optional;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
Expand Down
8 changes: 4 additions & 4 deletions common/api/common.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -4205,7 +4205,7 @@ final class dev.kord.common.entity/DiscordPinsUpdateData { // dev.kord.common.en
}

final class dev.kord.common.entity/DiscordPoll { // dev.kord.common.entity/DiscordPoll|null[0]
constructor <init>(dev.kord.common.entity/DiscordPoll.Media, kotlin.collections/List<dev.kord.common.entity/DiscordPoll.Answer>, kotlinx.datetime/Instant?, kotlin/Boolean, dev.kord.common.entity/PollLayoutType, dev.kord.common.entity/DiscordPoll.Results?) // dev.kord.common.entity/DiscordPoll.<init>|<init>(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List<dev.kord.common.entity.DiscordPoll.Answer>;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.DiscordPoll.Results?){}[0]
constructor <init>(dev.kord.common.entity/DiscordPoll.Media, kotlin.collections/List<dev.kord.common.entity/DiscordPoll.Answer>, kotlinx.datetime/Instant?, kotlin/Boolean, dev.kord.common.entity/PollLayoutType, dev.kord.common.entity.optional/Optional<dev.kord.common.entity/DiscordPoll.Results> = ...) // dev.kord.common.entity/DiscordPoll.<init>|<init>(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List<dev.kord.common.entity.DiscordPoll.Answer>;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.optional.Optional<dev.kord.common.entity.DiscordPoll.Results>){}[0]

final val allowMultiselect // dev.kord.common.entity/DiscordPoll.allowMultiselect|{}allowMultiselect[0]
final fun <get-allowMultiselect>(): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.allowMultiselect.<get-allowMultiselect>|<get-allowMultiselect>(){}[0]
Expand All @@ -4218,15 +4218,15 @@ final class dev.kord.common.entity/DiscordPoll { // dev.kord.common.entity/Disco
final val question // dev.kord.common.entity/DiscordPoll.question|{}question[0]
final fun <get-question>(): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.question.<get-question>|<get-question>(){}[0]
final val results // dev.kord.common.entity/DiscordPoll.results|{}results[0]
final fun <get-results>(): dev.kord.common.entity/DiscordPoll.Results? // dev.kord.common.entity/DiscordPoll.results.<get-results>|<get-results>(){}[0]
final fun <get-results>(): dev.kord.common.entity.optional/Optional<dev.kord.common.entity/DiscordPoll.Results> // dev.kord.common.entity/DiscordPoll.results.<get-results>|<get-results>(){}[0]

final fun component1(): dev.kord.common.entity/DiscordPoll.Media // dev.kord.common.entity/DiscordPoll.component1|component1(){}[0]
final fun component2(): kotlin.collections/List<dev.kord.common.entity/DiscordPoll.Answer> // dev.kord.common.entity/DiscordPoll.component2|component2(){}[0]
final fun component3(): kotlinx.datetime/Instant? // dev.kord.common.entity/DiscordPoll.component3|component3(){}[0]
final fun component4(): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.component4|component4(){}[0]
final fun component5(): dev.kord.common.entity/PollLayoutType // dev.kord.common.entity/DiscordPoll.component5|component5(){}[0]
final fun component6(): dev.kord.common.entity/DiscordPoll.Results? // dev.kord.common.entity/DiscordPoll.component6|component6(){}[0]
final fun copy(dev.kord.common.entity/DiscordPoll.Media = ..., kotlin.collections/List<dev.kord.common.entity/DiscordPoll.Answer> = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., dev.kord.common.entity/PollLayoutType = ..., dev.kord.common.entity/DiscordPoll.Results? = ...): dev.kord.common.entity/DiscordPoll // dev.kord.common.entity/DiscordPoll.copy|copy(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List<dev.kord.common.entity.DiscordPoll.Answer>;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.DiscordPoll.Results?){}[0]
final fun component6(): dev.kord.common.entity.optional/Optional<dev.kord.common.entity/DiscordPoll.Results> // dev.kord.common.entity/DiscordPoll.component6|component6(){}[0]
final fun copy(dev.kord.common.entity/DiscordPoll.Media = ..., kotlin.collections/List<dev.kord.common.entity/DiscordPoll.Answer> = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean = ..., dev.kord.common.entity/PollLayoutType = ..., dev.kord.common.entity.optional/Optional<dev.kord.common.entity/DiscordPoll.Results> = ...): dev.kord.common.entity/DiscordPoll // dev.kord.common.entity/DiscordPoll.copy|copy(dev.kord.common.entity.DiscordPoll.Media;kotlin.collections.List<dev.kord.common.entity.DiscordPoll.Answer>;kotlinx.datetime.Instant?;kotlin.Boolean;dev.kord.common.entity.PollLayoutType;dev.kord.common.entity.optional.Optional<dev.kord.common.entity.DiscordPoll.Results>){}[0]
final fun equals(kotlin/Any?): kotlin/Boolean // dev.kord.common.entity/DiscordPoll.equals|equals(kotlin.Any?){}[0]
final fun hashCode(): kotlin/Int // dev.kord.common.entity/DiscordPoll.hashCode|hashCode(){}[0]
final fun toString(): kotlin/String // dev.kord.common.entity/DiscordPoll.toString|toString(){}[0]
Expand Down
2 changes: 1 addition & 1 deletion common/src/commonMain/kotlin/entity/DiscordMessage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ public data class DiscordPoll(
val allowMultiselect: Boolean,
@SerialName("layout_type")
val layoutType: PollLayoutType,
val results: Results?
val results: Optional<Results> = Optional.Missing(),
) {
/**
* Shared object between answers and questions.
Expand Down

0 comments on commit 3efd971

Please sign in to comment.