From 6e2f3b508e2a3187d67810563f31f446a341c5aa Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 19 Sep 2025 13:17:47 -0400 Subject: [PATCH 1/3] misc: deprecatedUntilVersion annotation --- runtime/runtime-core/api/runtime-core.api | 5 +++++ .../src/aws/smithy/kotlin/runtime/Annotations.kt | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/runtime/runtime-core/api/runtime-core.api b/runtime/runtime-core/api/runtime-core.api index fcc7f6727a..1db1d10663 100644 --- a/runtime/runtime-core/api/runtime-core.api +++ b/runtime/runtime-core/api/runtime-core.api @@ -15,6 +15,11 @@ public class aws/smithy/kotlin/runtime/ClientException : aws/smithy/kotlin/runti public fun (Ljava/lang/Throwable;)V } +public abstract interface annotation class aws/smithy/kotlin/runtime/DeprecatedUntilVersion : java/lang/annotation/Annotation { + public abstract fun major ()I + public abstract fun minor ()I +} + public class aws/smithy/kotlin/runtime/ErrorMetadata { public static final field Companion Laws/smithy/kotlin/runtime/ErrorMetadata$Companion; public fun ()V diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt index ee3ab01e28..ff1678c9bd 100644 --- a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt +++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt @@ -58,3 +58,16 @@ public annotation class ExperimentalApi */ @DslMarker public annotation class SdkDsl + +/** + * Indicates that the annotated API is deprecated and scheduled for removal in an upcoming minor version. + * Any code using this API should migrate to the suggested replacement as soon as possible. + */ +@RequiresOptIn( + message = "This API is deprecated and will be removed in an upcoming minor version.", + level = RequiresOptIn.Level.WARNING, +) +public annotation class DeprecatedUntilVersion( + val major: Int, + val minor: Int, +) From 576e3e1160d8f590787b33530f6215d66f2c5d04 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Mon, 22 Sep 2025 12:37:14 -0400 Subject: [PATCH 2/3] feedback --- runtime/runtime-core/api/runtime-core.api | 10 +++++----- .../src/aws/smithy/kotlin/runtime/Annotations.kt | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/runtime-core/api/runtime-core.api b/runtime/runtime-core/api/runtime-core.api index 1db1d10663..3b88bc6401 100644 --- a/runtime/runtime-core/api/runtime-core.api +++ b/runtime/runtime-core/api/runtime-core.api @@ -15,11 +15,6 @@ public class aws/smithy/kotlin/runtime/ClientException : aws/smithy/kotlin/runti public fun (Ljava/lang/Throwable;)V } -public abstract interface annotation class aws/smithy/kotlin/runtime/DeprecatedUntilVersion : java/lang/annotation/Annotation { - public abstract fun major ()I - public abstract fun minor ()I -} - public class aws/smithy/kotlin/runtime/ErrorMetadata { public static final field Companion Laws/smithy/kotlin/runtime/ErrorMetadata$Companion; public fun ()V @@ -41,6 +36,11 @@ public abstract interface annotation class aws/smithy/kotlin/runtime/Experimenta public abstract interface annotation class aws/smithy/kotlin/runtime/InternalApi : java/lang/annotation/Annotation { } +public abstract interface annotation class aws/smithy/kotlin/runtime/PlannedRemoval : java/lang/annotation/Annotation { + public abstract fun major ()I + public abstract fun minor ()I +} + public abstract interface class aws/smithy/kotlin/runtime/ProtocolResponse { public abstract fun getSummary ()Ljava/lang/String; } diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt index ff1678c9bd..07fdadc715 100644 --- a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt +++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt @@ -60,14 +60,14 @@ public annotation class ExperimentalApi public annotation class SdkDsl /** - * Indicates that the annotated API is deprecated and scheduled for removal in an upcoming minor version. + * Indicates that the annotated API is deprecated and scheduled for removal in an upcoming version. * Any code using this API should migrate to the suggested replacement as soon as possible. */ @RequiresOptIn( - message = "This API is deprecated and will be removed in an upcoming minor version.", + message = "This API is deprecated and will be scheduled for removal in an upcoming version.", level = RequiresOptIn.Level.WARNING, ) -public annotation class DeprecatedUntilVersion( +public annotation class PlannedRemoval( val major: Int, val minor: Int, ) From c7a0e0379e6818ab77109b1d7ff02d9aabdd71e8 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Mon, 22 Sep 2025 12:39:10 -0400 Subject: [PATCH 3/3] self review --- .../common/src/aws/smithy/kotlin/runtime/Annotations.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt index 07fdadc715..0a9dac6a55 100644 --- a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt +++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Annotations.kt @@ -64,7 +64,7 @@ public annotation class SdkDsl * Any code using this API should migrate to the suggested replacement as soon as possible. */ @RequiresOptIn( - message = "This API is deprecated and will be scheduled for removal in an upcoming version.", + message = "This API is deprecated and scheduled for removal in an upcoming version.", level = RequiresOptIn.Level.WARNING, ) public annotation class PlannedRemoval(