Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump DeprecationLevels #688

Merged
merged 6 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -4100,7 +4100,7 @@ public final class dev/kord/common/entity/DiscordInvite : dev/kord/common/entity
public fun getTargetApplication ()Ldev/kord/common/entity/optional/Optional;
public fun getTargetType ()Ldev/kord/common/entity/optional/Optional;
public fun getTargetUser ()Ldev/kord/common/entity/optional/Optional;
public final fun getTargetUserType ()Ldev/kord/common/entity/optional/Optional;
public final synthetic fun getTargetUserType ()Ldev/kord/common/entity/optional/Optional;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final fun write$Self (Ldev/kord/common/entity/DiscordInvite;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
Expand Down Expand Up @@ -6379,7 +6379,7 @@ public final class dev/kord/common/entity/IntegrationApplication {
public final fun getIcon ()Ljava/lang/String;
public final fun getId ()Ldev/kord/common/entity/Snowflake;
public final fun getName ()Ljava/lang/String;
public final fun getSummary ()Ljava/lang/String;
public final synthetic fun getSummary ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final fun write$Self (Ldev/kord/common/entity/IntegrationApplication;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
Expand Down Expand Up @@ -7181,8 +7181,6 @@ public final class dev/kord/common/entity/Permission$ChangeNickname : dev/kord/c
}

public final class dev/kord/common/entity/Permission$Companion {
public final synthetic fun getManageEmojis ()Ldev/kord/common/entity/Permission$ManageEmojisAndStickers;
public final synthetic fun getUseSlashCommands ()Ldev/kord/common/entity/Permission$UseApplicationCommands;
public final fun getValues ()Ljava/util/Set;
}

Expand Down Expand Up @@ -7595,11 +7593,10 @@ public final class dev/kord/common/entity/Snowflake : java/lang/Comparable {
public final fun component3-w2LRezQ ()B
public final fun component4-Mh2AYeg ()S
public fun equals (Ljava/lang/Object;)Z
public final fun getAsString ()Ljava/lang/String;
public final synthetic fun getAsString ()Ljava/lang/String;
public final fun getIncrement-Mh2AYeg ()S
public final fun getProcessId-w2LRezQ ()B
public final fun getTimeMark ()Lkotlin/time/TimeMark;
public final synthetic fun getTimeStamp ()Lkotlinx/datetime/Instant;
public final fun getTimestamp ()Lkotlinx/datetime/Instant;
public final fun getValue-s-VKNKU ()J
public final fun getWorkerId-w2LRezQ ()B
Expand All @@ -7609,7 +7606,6 @@ public final class dev/kord/common/entity/Snowflake : java/lang/Comparable {

public final class dev/kord/common/entity/Snowflake$Companion {
public final fun getDiscordEpoch ()Lkotlinx/datetime/Instant;
public final synthetic fun getDiscordEpochStart ()Lkotlinx/datetime/Instant;
public final fun getEndOfTime ()Lkotlinx/datetime/Instant;
public final fun getMax ()Ldev/kord/common/entity/Snowflake;
public final fun getMin ()Ldev/kord/common/entity/Snowflake;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public sealed class ChannelType(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
level = DeprecationLevel.HIDDEN,
message =
"Discord no longer offers the ability to purchase a license to sell PC games on Discord and store channels were removed on March 10, 2022. See https://support-dev.discord.com/hc/en-us/articles/6309018858647-Self-serve-Game-Selling-Deprecation for more information.",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,21 @@ public sealed class GuildFeature(
*
* @suppress.
*/
@Deprecated(message = "Thread archive durations are no longer boost locked.")
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Thread archive durations are no longer boost locked.",
)
public object ThreeDayThreadArchive : GuildFeature("THREE_DAY_THREAD_ARCHIVE")

/**
* Guild has access to the seven day archive time for threads.
*
* @suppress
*/
@Deprecated(message = "Thread archive durations are no longer boost locked.")
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Thread archive durations are no longer boost locked.",
)
public object SevenDayThreadArchive : GuildFeature("SEVEN_DAY_THREAD_ARCHIVE")

internal object Serializer : KSerializer<GuildFeature> {
Expand Down Expand Up @@ -206,8 +212,8 @@ public sealed class GuildFeature(
"PREVIEW_ENABLED" -> PreviewEnabled
"PRIVATE_THREADS" -> PrivateThreads
"ROLE_ICONS" -> RoleIcons
"SEVEN_DAY_THREAD_ARCHIVE" -> @Suppress("DEPRECATION") SevenDayThreadArchive
"THREE_DAY_THREAD_ARCHIVE" -> @Suppress("DEPRECATION") ThreeDayThreadArchive
"SEVEN_DAY_THREAD_ARCHIVE" -> @Suppress("DEPRECATION_ERROR") SevenDayThreadArchive
"THREE_DAY_THREAD_ARCHIVE" -> @Suppress("DEPRECATION_ERROR") ThreeDayThreadArchive
"TICKETED_EVENTS_ENABLED" -> TicketedEventsEnabled
"VANITY_URL" -> VanityUrl
"VERIFIED" -> Verified
Expand Down Expand Up @@ -240,8 +246,8 @@ public sealed class GuildFeature(
PreviewEnabled,
PrivateThreads,
RoleIcons,
@Suppress("DEPRECATION") SevenDayThreadArchive,
@Suppress("DEPRECATION") ThreeDayThreadArchive,
@Suppress("DEPRECATION_ERROR") SevenDayThreadArchive,
@Suppress("DEPRECATION_ERROR") ThreeDayThreadArchive,
TicketedEventsEnabled,
VanityUrl,
Verified,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package dev.kord.common.entity
import kotlin.Any
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.DeprecationLevel
import kotlin.Int
import kotlin.LazyThreadSafetyMode.PUBLICATION
import kotlin.ReplaceWith
Expand Down Expand Up @@ -98,6 +99,7 @@ public sealed class MessageType(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'UserJoin'.",
replaceWith = ReplaceWith(expression = "UserJoin", imports =
arrayOf("dev.kord.common.entity.MessageType.UserJoin")),
Expand All @@ -108,6 +110,7 @@ public sealed class MessageType(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'GuildBoost'.",
replaceWith = ReplaceWith(expression = "GuildBoost", imports =
arrayOf("dev.kord.common.entity.MessageType.GuildBoost")),
Expand All @@ -118,6 +121,7 @@ public sealed class MessageType(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'GuildBoostTier1'.",
replaceWith = ReplaceWith(expression = "GuildBoostTier1", imports =
arrayOf("dev.kord.common.entity.MessageType.GuildBoostTier1")),
Expand All @@ -128,6 +132,7 @@ public sealed class MessageType(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'GuildBoostTier2'.",
replaceWith = ReplaceWith(expression = "GuildBoostTier2", imports =
arrayOf("dev.kord.common.entity.MessageType.GuildBoostTier2")),
Expand All @@ -138,6 +143,7 @@ public sealed class MessageType(
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'GuildBoostTier3'.",
replaceWith = ReplaceWith(expression = "GuildBoostTier3", imports =
arrayOf("dev.kord.common.entity.MessageType.GuildBoostTier3")),
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/kotlin/entity/DiscordChannel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"Discord and store channels were removed on March 10, 2022. See " +
"https://support-dev.discord.com/hc/en-us/articles/6309018858647-Self-serve-Game-Selling-Deprecation" +
" for more information.",
deprecationLevel = ERROR,
deprecationLevel = HIDDEN,
),
],
)
Expand Down Expand Up @@ -77,7 +77,7 @@ import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlin.DeprecationLevel.ERROR
import kotlin.DeprecationLevel.HIDDEN
import kotlin.time.Duration
import kotlin.time.Duration.Companion.minutes

Expand Down
5 changes: 2 additions & 3 deletions common/src/main/kotlin/entity/DiscordGuild.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@
Entry(
"ThreeDayThreadArchive", stringValue = "THREE_DAY_THREAD_ARCHIVE",
kDoc = "Guild has access to the three-day archive time for threads\n\n@suppress.",
deprecationMessage = "Thread archive durations are no longer boost locked.", deprecationLevel = WARNING,
deprecationMessage = "Thread archive durations are no longer boost locked.", deprecationLevel = ERROR,
),
Entry(
"SevenDayThreadArchive", stringValue = "SEVEN_DAY_THREAD_ARCHIVE",
kDoc = "Guild has access to the seven day archive time for threads.\n\n@suppress",
deprecationMessage = "Thread archive durations are no longer boost locked.", deprecationLevel = WARNING,
deprecationMessage = "Thread archive durations are no longer boost locked.", deprecationLevel = ERROR,
),
],
)
Expand All @@ -157,7 +157,6 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlin.DeprecationLevel.ERROR
import kotlin.DeprecationLevel.WARNING

/**
* A partial representation of a [DiscordGuild] that may be [unavailable].
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/kotlin/entity/DiscordIntegration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import dev.kord.ksp.GenerateKordEnum.ValueType.INT
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlin.DeprecationLevel.ERROR
import kotlin.DeprecationLevel.HIDDEN

@Serializable
public data class DiscordIntegration(
Expand Down Expand Up @@ -59,7 +59,7 @@ public data class IntegrationApplication(
val icon: String?,
val description: String,
/** @suppress */
@Deprecated("This is deprecated and will always be empty.", level = ERROR)
@Deprecated("This is deprecated and will always be empty.", level = HIDDEN)
val summary: String,
val bot: Optional<DiscordUser> = Optional.Missing(),
)
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/kotlin/entity/DiscordInvite.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import dev.kord.ksp.GenerateKordEnum.ValueType.INT
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlin.DeprecationLevel.ERROR
import kotlin.DeprecationLevel.HIDDEN

public sealed interface BaseDiscordInvite {
public val code: String
Expand Down Expand Up @@ -46,7 +46,7 @@ public data class DiscordInvite(
@SerialName("target_application")
override val targetApplication: Optional<DiscordPartialApplication> = Optional.Missing(),
/** @suppress */
@Deprecated("This is no longer documented. Use 'targetType' instead.", ReplaceWith("this.targetType"), level = ERROR)
@Deprecated("This is no longer documented. Use 'targetType' instead.", ReplaceWith("this.targetType"), level = HIDDEN)
@SerialName("target_user_type")
val targetUserType: Optional<@Suppress("DEPRECATION_ERROR") TargetUserType> = Optional.Missing(),
@SerialName("approximate_presence_count")
Expand Down
12 changes: 6 additions & 6 deletions common/src/main/kotlin/entity/DiscordMessage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@
deprecatedEntries = [
Entry(
"GuildMemberJoin", intValue = 7, kDoc = "@suppress",
deprecationMessage = "Renamed to 'UserJoin'.", deprecationLevel = WARNING,
deprecationMessage = "Renamed to 'UserJoin'.", deprecationLevel = ERROR,
replaceWith = ReplaceWith("UserJoin", "dev.kord.common.entity.MessageType.UserJoin"),
),
Entry(
"UserPremiumGuildSubscription", intValue = 8, kDoc = "@suppress",
deprecationMessage = "Renamed to 'GuildBoost'.", deprecationLevel = WARNING,
deprecationMessage = "Renamed to 'GuildBoost'.", deprecationLevel = ERROR,
replaceWith = ReplaceWith("GuildBoost", "dev.kord.common.entity.MessageType.GuildBoost"),
),
Entry(
"UserPremiumGuildSubscriptionTierOne", intValue = 9, kDoc = "@suppress",
deprecationMessage = "Renamed to 'GuildBoostTier1'.", deprecationLevel = WARNING,
deprecationMessage = "Renamed to 'GuildBoostTier1'.", deprecationLevel = ERROR,
replaceWith = ReplaceWith("GuildBoostTier1", "dev.kord.common.entity.MessageType.GuildBoostTier1"),
),
Entry(
"UserPremiumGuildSubscriptionTwo", intValue = 10, kDoc = "@suppress",
deprecationMessage = "Renamed to 'GuildBoostTier2'.", deprecationLevel = WARNING,
deprecationMessage = "Renamed to 'GuildBoostTier2'.", deprecationLevel = ERROR,
replaceWith = ReplaceWith("GuildBoostTier2", "dev.kord.common.entity.MessageType.GuildBoostTier2"),
),
Entry(
"UserPremiumGuildSubscriptionThree", intValue = 11, kDoc = "@suppress",
deprecationMessage = "Renamed to 'GuildBoostTier3'.", deprecationLevel = WARNING,
deprecationMessage = "Renamed to 'GuildBoostTier3'.", deprecationLevel = ERROR,
replaceWith = ReplaceWith("GuildBoostTier3", "dev.kord.common.entity.MessageType.GuildBoostTier3"),
),
],
Expand Down Expand Up @@ -120,7 +120,7 @@ import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlin.DeprecationLevel.WARNING
import kotlin.DeprecationLevel.ERROR
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

Expand Down
4 changes: 2 additions & 2 deletions common/src/main/kotlin/entity/Invite.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlin.DeprecationLevel.ERROR
import kotlin.DeprecationLevel.HIDDEN

/** @suppress */
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This is no longer documented. Use 'InviteTargetType' instead.",
ReplaceWith("InviteTargetType", "dev.kord.common.entity.InviteTargetType"),
level = ERROR,
level = HIDDEN,
)
@Serializable(with = TargetUserType.Serializer::class)
public sealed class TargetUserType(public val value: Int) {
Expand Down
16 changes: 0 additions & 16 deletions common/src/main/kotlin/entity/Permission.kt
Original file line number Diff line number Diff line change
Expand Up @@ -288,22 +288,6 @@ public sealed class Permission(public val code: DiscordBitSet) {

public companion object {

@Deprecated(
"Renamed to 'ManageEmojisAndStickers'.",
ReplaceWith("Permission.ManageEmojisAndStickers", "dev.kord.common.entity.Permission"),
DeprecationLevel.HIDDEN,
)
public val ManageEmojis: ManageEmojisAndStickers
get() = ManageEmojisAndStickers

@Deprecated(
"Renamed to 'UseApplicationCommands'.",
ReplaceWith("Permission.UseApplicationCommands", "dev.kord.common.entity.Permission"),
DeprecationLevel.HIDDEN,
)
public val UseSlashCommands: UseApplicationCommands
get() = UseApplicationCommands

// We cannot inline this into the "All" object, because that causes a weird compiler error
private fun buildAll(): DiscordBitSet = values.fold(EmptyBitSet()) { acc, value -> acc + value.code }

Expand Down
21 changes: 1 addition & 20 deletions common/src/main/kotlin/entity/Snowflake.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import kotlinx.serialization.builtins.serializer
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlin.DeprecationLevel.ERROR
import kotlin.DeprecationLevel.HIDDEN
import kotlin.time.Duration
import kotlin.time.TimeMark
Expand Down Expand Up @@ -71,17 +70,10 @@ public class Snowflake : Comparable<Snowflake> {
*
* @suppress
*/
@Deprecated("Use toString() instead", ReplaceWith("toString()"), level = ERROR)
@Deprecated("Use toString() instead", ReplaceWith("toString()"), level = HIDDEN)
public val asString: String
get() = value.toString()

/**
* The point in time this Snowflake represents.
*/
@Deprecated("timeStamp was renamed to timestamp.", ReplaceWith("timestamp"), level = HIDDEN)
public val timeStamp: Instant
get() = timestamp

/**
* The point in time this Snowflake represents.
*/
Expand Down Expand Up @@ -204,17 +196,6 @@ public class Snowflake : Comparable<Snowflake> {
*/
public val max: Snowflake = Snowflake(validValues.last)

/**
* The point in time that marks the Discord Epoch (the first second of 2015).
*/
@Deprecated(
"Snowflake.discordEpochStart was renamed to Snowflake.discordEpoch.",
ReplaceWith("Snowflake.discordEpoch"),
level = HIDDEN,
)
public val discordEpochStart: Instant
get() = discordEpoch

/**
* The point in time that marks the Discord Epoch (the first second of 2015).
*/
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/kotlin/ratelimit/BucketRateLimiter.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.kord.common.ratelimit

import kotlinx.datetime.Clock
import kotlin.DeprecationLevel.ERROR
import kotlin.DeprecationLevel.HIDDEN
import kotlin.time.Duration


Expand All @@ -20,7 +20,7 @@ import kotlin.time.Duration
"IntervalRateLimiter(limit = capacity, interval = refillInterval)",
"dev.kord.common.ratelimit.IntervalRateLimiter",
),
level = ERROR,
level = HIDDEN,
)
public class BucketRateLimiter(
capacity: Int,
Expand Down
Loading