diff --git a/common/api/common.api b/common/api/common.api index d02a5a2763b6..d2dd320b2e45 100644 --- a/common/api/common.api +++ b/common/api/common.api @@ -584,6 +584,56 @@ public final class dev/kord/common/entity/ApplicationFlags$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract class dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field Companion Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$Companion; + public synthetic fun (ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun equals (Ljava/lang/Object;)Z + public final fun getValue ()I + public final fun hashCode ()I + public final fun toString ()Ljava/lang/String; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$BooleanEqual : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field INSTANCE Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$BooleanEqual; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$BooleanNotEqual : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field INSTANCE Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$BooleanNotEqual; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$Companion { + public final fun getEntries ()Ljava/util/List; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$DateTimeGreaterThanOrEqual : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field INSTANCE Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$DateTimeGreaterThanOrEqual; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$DateTimeLessThanOrEqual : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field INSTANCE Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$DateTimeLessThanOrEqual; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$IntegerEqual : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field INSTANCE Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$IntegerEqual; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$IntegerGreaterThanOrEqual : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field INSTANCE Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$IntegerGreaterThanOrEqual; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$IntegerLessThanOrEqual : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field INSTANCE Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$IntegerLessThanOrEqual; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$IntegerNotEqual : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public static final field INSTANCE Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType$IntegerNotEqual; +} + +public final class dev/kord/common/entity/ApplicationRoleConnectionMetadataType$Unknown : dev/kord/common/entity/ApplicationRoleConnectionMetadataType { + public fun (I)V +} + public abstract class dev/kord/common/entity/ArchiveDuration { public static final field Companion Ldev/kord/common/entity/ArchiveDuration$Companion; public synthetic fun (JLkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -1304,6 +1354,7 @@ public abstract interface class dev/kord/common/entity/BaseDiscordApplication { public abstract fun getOwner ()Ldev/kord/common/entity/optional/Optional; public abstract fun getPrimarySkuId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public abstract fun getPrivacyPolicyUrl ()Ldev/kord/common/entity/optional/Optional; + public abstract fun getRoleConnectionsVerificationUrl ()Ldev/kord/common/entity/optional/Optional; public abstract fun getRpcOrigins ()Ldev/kord/common/entity/optional/Optional; public abstract fun getSlug ()Ldev/kord/common/entity/optional/Optional; public abstract fun getTags ()Ldev/kord/common/entity/optional/Optional; @@ -2232,9 +2283,9 @@ public final class dev/kord/common/entity/DiscordAddedGuildMember$Companion { public final class dev/kord/common/entity/DiscordApplication : dev/kord/common/entity/BaseDiscordApplication { public static final field Companion Ldev/kord/common/entity/DiscordApplication$Companion; - public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/Snowflake; public final fun component10 ()Ldev/kord/common/entity/optional/Optional; public final fun component11 ()Ljava/lang/String; @@ -2248,6 +2299,7 @@ public final class dev/kord/common/entity/DiscordApplication : dev/kord/common/e public final fun component19 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ljava/lang/String; public final fun component20 ()Ldev/kord/common/entity/optional/Optional; + public final fun component21 ()Ldev/kord/common/entity/optional/Optional; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; public final fun component5 ()Ldev/kord/common/entity/optional/Optional; @@ -2255,8 +2307,8 @@ public final class dev/kord/common/entity/DiscordApplication : dev/kord/common/e public final fun component7 ()Z public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordApplication; - public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordApplication;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordApplication; + public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordApplication; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordApplication;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/DiscordTeam;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordApplication; public fun equals (Ljava/lang/Object;)Z public final fun getBotPublic ()Z public final fun getBotRequireCodeGrant ()Z @@ -2272,6 +2324,7 @@ public final class dev/kord/common/entity/DiscordApplication : dev/kord/common/e public fun getOwner ()Ldev/kord/common/entity/optional/Optional; public fun getPrimarySkuId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public fun getPrivacyPolicyUrl ()Ldev/kord/common/entity/optional/Optional; + public fun getRoleConnectionsVerificationUrl ()Ldev/kord/common/entity/optional/Optional; public fun getRpcOrigins ()Ldev/kord/common/entity/optional/Optional; public fun getSlug ()Ldev/kord/common/entity/optional/Optional; public fun getTags ()Ldev/kord/common/entity/optional/Optional; @@ -2362,6 +2415,46 @@ public final class dev/kord/common/entity/DiscordApplicationKt { public static final fun ApplicationFlagsWithIterable (Ljava/lang/Iterable;)Ldev/kord/common/entity/ApplicationFlags; } +public final class dev/kord/common/entity/DiscordApplicationRoleConnectionMetadata { + public static final field Companion Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata$Companion; + public synthetic fun (ILdev/kord/common/entity/ApplicationRoleConnectionMetadataType;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Ljava/lang/String; + public final fun component4 ()Ldev/kord/common/entity/optional/Optional; + public final fun component5 ()Ljava/lang/String; + public final fun component6 ()Ldev/kord/common/entity/optional/Optional; + public final fun copy (Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata;Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata; + public fun equals (Ljava/lang/Object;)Z + public final fun getDescription ()Ljava/lang/String; + public final fun getDescriptionLocalizations ()Ldev/kord/common/entity/optional/Optional; + public final fun getKey ()Ljava/lang/String; + public final fun getName ()Ljava/lang/String; + public final fun getNameLocalizations ()Ldev/kord/common/entity/optional/Optional; + public final fun getType ()Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public final class dev/kord/common/entity/DiscordApplicationRoleConnectionMetadata$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata$$serializer; + public fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/kord/common/entity/DiscordApplicationRoleConnectionMetadata$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/kord/common/entity/DiscordAttachment { public static final field Companion Ldev/kord/common/entity/DiscordAttachment$Companion; public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalInt;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V @@ -4760,9 +4853,9 @@ public final class dev/kord/common/entity/DiscordOptionallyMemberUser$Companion public final class dev/kord/common/entity/DiscordPartialApplication : dev/kord/common/entity/BaseDiscordApplication { public static final field Companion Ldev/kord/common/entity/DiscordPartialApplication$Companion; - public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/Snowflake; public final fun component10 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component11 ()Ldev/kord/common/entity/optional/OptionalSnowflake; @@ -4772,6 +4865,7 @@ public final class dev/kord/common/entity/DiscordPartialApplication : dev/kord/c public final fun component15 ()Ldev/kord/common/entity/optional/Optional; public final fun component16 ()Ldev/kord/common/entity/optional/Optional; public final fun component17 ()Ldev/kord/common/entity/optional/Optional; + public final fun component18 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; @@ -4780,8 +4874,8 @@ public final class dev/kord/common/entity/DiscordPartialApplication : dev/kord/c public final fun component7 ()Ldev/kord/common/entity/optional/Optional; public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ljava/lang/String; - public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordPartialApplication; - public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPartialApplication;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPartialApplication; + public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/DiscordPartialApplication; + public static synthetic fun copy$default (Ldev/kord/common/entity/DiscordPartialApplication;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/common/entity/DiscordPartialApplication; public fun equals (Ljava/lang/Object;)Z public fun getCoverImage ()Ldev/kord/common/entity/optional/Optional; public fun getCustomInstallUrl ()Ldev/kord/common/entity/optional/Optional; @@ -4795,6 +4889,7 @@ public final class dev/kord/common/entity/DiscordPartialApplication : dev/kord/c public fun getOwner ()Ldev/kord/common/entity/optional/Optional; public fun getPrimarySkuId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public fun getPrivacyPolicyUrl ()Ldev/kord/common/entity/optional/Optional; + public fun getRoleConnectionsVerificationUrl ()Ldev/kord/common/entity/optional/Optional; public fun getRpcOrigins ()Ldev/kord/common/entity/optional/Optional; public fun getSlug ()Ldev/kord/common/entity/optional/Optional; public fun getTags ()Ldev/kord/common/entity/optional/Optional; @@ -8444,6 +8539,7 @@ public final class dev/kord/common/entity/optional/OptionalKt { public static final fun flatMap (Ldev/kord/common/entity/optional/Optional;Lkotlin/jvm/functions/Function1;)Ldev/kord/common/entity/optional/Optional; public static final fun map (Ldev/kord/common/entity/optional/Optional;Lkotlin/jvm/functions/Function1;)Ldev/kord/common/entity/optional/Optional; public static final fun mapCopy (Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/optional/Optional; + public static final fun mapCopyOfMap (Ldev/kord/common/entity/optional/Optional;)Ldev/kord/common/entity/optional/Optional; public static final fun mapList (Ldev/kord/common/entity/optional/Optional;Lkotlin/jvm/functions/Function1;)Ldev/kord/common/entity/optional/Optional; public static final fun mapNotNull (Ldev/kord/common/entity/optional/Optional;Lkotlin/jvm/functions/Function1;)Ldev/kord/common/entity/optional/Optional; public static final fun mapNullable (Ldev/kord/common/entity/optional/Optional;Lkotlin/jvm/functions/Function1;)Ldev/kord/common/entity/optional/Optional; diff --git a/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationRoleConnectionMetadataType.kt b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationRoleConnectionMetadataType.kt new file mode 100644 index 000000000000..2f941b28036e --- /dev/null +++ b/common/build/generated/ksp/metadata/commonMain/kotlin/dev/kord/common/entity/ApplicationRoleConnectionMetadataType.kt @@ -0,0 +1,140 @@ +// THIS FILE IS AUTO-GENERATED BY KordEnumProcessor.kt, DO NOT EDIT! +@file:Suppress(names = arrayOf("RedundantVisibilityModifier", "IncorrectFormatting", + "ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection")) + +package dev.kord.common.entity + +import kotlin.Any +import kotlin.Boolean +import kotlin.Int +import kotlin.LazyThreadSafetyMode.PUBLICATION +import kotlin.String +import kotlin.Suppress +import kotlin.collections.List +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializable +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * Each [ApplicationRoleConnectionMetadataType] offers a comparison operation that allows guilds to + * configure role requirements based on metadata values stored by the bot. Bots specify a 'metadata + * value' for each user and guilds specify the required 'guild's configured value' within the guild + * role settings. + * + * See [ApplicationRoleConnectionMetadataType]s in the + * [Discord Developer Documentation](https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type). + */ +@Serializable(with = ApplicationRoleConnectionMetadataType.Serializer::class) +public sealed class ApplicationRoleConnectionMetadataType( + /** + * The raw value used by Discord. + */ + public val `value`: Int, +) { + public final override fun equals(other: Any?): Boolean = this === other || + (other is ApplicationRoleConnectionMetadataType && this.value == other.value) + + public final override fun hashCode(): Int = value.hashCode() + + public final override fun toString(): String = + "ApplicationRoleConnectionMetadataType.${this::class.simpleName}(value=$value)" + + /** + * An unknown [ApplicationRoleConnectionMetadataType]. + * + * This is used as a fallback for [ApplicationRoleConnectionMetadataType]s that haven't been + * added to Kord yet. + */ + public class Unknown( + `value`: Int, + ) : ApplicationRoleConnectionMetadataType(value) + + /** + * The metadata value (`integer`) is less than or equal to the guild's configured value + * (`integer`). + */ + public object IntegerLessThanOrEqual : ApplicationRoleConnectionMetadataType(1) + + /** + * The metadata value (`integer`) is greater than or equal to the guild's configured value + * (`integer`). + */ + public object IntegerGreaterThanOrEqual : ApplicationRoleConnectionMetadataType(2) + + /** + * The metadata value (`integer`) is equal to the guild's configured value (`integer`). + */ + public object IntegerEqual : ApplicationRoleConnectionMetadataType(3) + + /** + * The metadata value (`integer`) is not equal to the guild's configured value (`integer`). + */ + public object IntegerNotEqual : ApplicationRoleConnectionMetadataType(4) + + /** + * The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value + * (`integer`; `days before current date`). + */ + public object DateTimeLessThanOrEqual : ApplicationRoleConnectionMetadataType(5) + + /** + * The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured + * value (`integer`; `days before current date`). + */ + public object DateTimeGreaterThanOrEqual : ApplicationRoleConnectionMetadataType(6) + + /** + * The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`). + */ + public object BooleanEqual : ApplicationRoleConnectionMetadataType(7) + + /** + * The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`). + */ + public object BooleanNotEqual : ApplicationRoleConnectionMetadataType(8) + + internal object Serializer : KSerializer { + public override val descriptor: SerialDescriptor = + PrimitiveSerialDescriptor("dev.kord.common.entity.ApplicationRoleConnectionMetadataType", + PrimitiveKind.INT) + + public override fun serialize(encoder: Encoder, + `value`: ApplicationRoleConnectionMetadataType) = encoder.encodeInt(value.value) + + public override fun deserialize(decoder: Decoder) = when (val value = decoder.decodeInt()) { + 1 -> IntegerLessThanOrEqual + 2 -> IntegerGreaterThanOrEqual + 3 -> IntegerEqual + 4 -> IntegerNotEqual + 5 -> DateTimeLessThanOrEqual + 6 -> DateTimeGreaterThanOrEqual + 7 -> BooleanEqual + 8 -> BooleanNotEqual + else -> Unknown(value) + } + } + + public companion object { + /** + * A [List] of all known [ApplicationRoleConnectionMetadataType]s. + */ + public val entries: List by + lazy(mode = PUBLICATION) { + listOf( + IntegerLessThanOrEqual, + IntegerGreaterThanOrEqual, + IntegerEqual, + IntegerNotEqual, + DateTimeLessThanOrEqual, + DateTimeGreaterThanOrEqual, + BooleanEqual, + BooleanNotEqual, + ) + } + + } +} diff --git a/common/src/commonMain/kotlin/entity/ApplicationRoleConnectionMetadata.kt b/common/src/commonMain/kotlin/entity/ApplicationRoleConnectionMetadata.kt new file mode 100644 index 000000000000..e91878236f1f --- /dev/null +++ b/common/src/commonMain/kotlin/entity/ApplicationRoleConnectionMetadata.kt @@ -0,0 +1,66 @@ +@file: GenerateKordEnum( + name = "ApplicationRoleConnectionMetadataType", valueType = INT, + kDoc = "Each [ApplicationRoleConnectionMetadataType] offers a comparison operation that allows guilds to " + + "configure role requirements based on metadata values stored by the bot. Bots specify a 'metadata value' for " + + "each user and guilds specify the required 'guild's configured value' within the guild role settings.", + docUrl = "https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type", + entries = [ + Entry( + "IntegerLessThanOrEqual", intValue = 1, + kDoc = "The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`).", + ), + Entry( + "IntegerGreaterThanOrEqual", intValue = 2, + kDoc = "The metadata value (`integer`) is greater than or equal to the guild's configured value " + + "(`integer`).", + ), + Entry( + "IntegerEqual", intValue = 3, + kDoc = "The metadata value (`integer`) is equal to the guild's configured value (`integer`).", + ), + Entry( + "IntegerNotEqual", intValue = 4, + kDoc = "The metadata value (`integer`) is not equal to the guild's configured value (`integer`).", + ), + Entry( + "DateTimeLessThanOrEqual", intValue = 5, + kDoc = "The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value " + + "(`integer`; `days before current date`).", + ), + Entry( + "DateTimeGreaterThanOrEqual", intValue = 6, + kDoc = "The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value " + + "(`integer`; `days before current date`).", + ), + Entry( + "BooleanEqual", intValue = 7, + kDoc = "The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`).", + ), + Entry( + "BooleanNotEqual", intValue = 8, + kDoc = "The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`).", + ), + ], +) + +package dev.kord.common.entity + +import dev.kord.common.Locale +import dev.kord.common.entity.optional.Optional +import dev.kord.ksp.GenerateKordEnum +import dev.kord.ksp.GenerateKordEnum.Entry +import dev.kord.ksp.GenerateKordEnum.ValueType.INT +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +public data class DiscordApplicationRoleConnectionMetadata( + val type: ApplicationRoleConnectionMetadataType, + val key: String, + val name: String, + @SerialName("name_localizations") + val nameLocalizations: Optional> = Optional.Missing(), + val description: String, + @SerialName("description_localizations") + val descriptionLocalizations: Optional> = Optional.Missing(), +) diff --git a/common/src/commonMain/kotlin/entity/DiscordApplication.kt b/common/src/commonMain/kotlin/entity/DiscordApplication.kt index f63c5a95de96..2d56619aa089 100644 --- a/common/src/commonMain/kotlin/entity/DiscordApplication.kt +++ b/common/src/commonMain/kotlin/entity/DiscordApplication.kt @@ -32,6 +32,7 @@ public sealed interface BaseDiscordApplication { public val tags: Optional> public val installParams: Optional public val customInstallUrl: Optional + public val roleConnectionsVerificationUrl: Optional } /** @@ -71,6 +72,8 @@ public data class DiscordApplication( override val installParams: Optional = Optional.Missing(), @SerialName("custom_install_url") override val customInstallUrl: Optional = Optional.Missing(), + @SerialName("role_connections_verification_url") + override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), ) : BaseDiscordApplication /** @@ -106,6 +109,8 @@ public data class DiscordPartialApplication( override val installParams: Optional = Optional.Missing(), @SerialName("custom_install_url") override val customInstallUrl: Optional = Optional.Missing(), + @SerialName("role_connections_verification_url") + override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), ) : BaseDiscordApplication public enum class ApplicationFlag(public val code: Int) { diff --git a/common/src/commonMain/kotlin/entity/optional/Optional.kt b/common/src/commonMain/kotlin/entity/optional/Optional.kt index 96b157dfe696..743631bf49ee 100644 --- a/common/src/commonMain/kotlin/entity/optional/Optional.kt +++ b/common/src/commonMain/kotlin/entity/optional/Optional.kt @@ -218,6 +218,9 @@ public inline fun Optional>.mapList(mapper: (E) -> T): Optional Optional>.mapCopy(): Optional> = map { mutable -> mutable.toList() } +@JvmName("mapCopyOfMap") +public fun Optional>.mapCopy(): Optional> = map { mutable -> mutable.toMap() } + @Suppress("UNCHECKED_CAST") public inline fun Optional>.mapValues(mapper: (Map.Entry) -> R): Optional> = when (this) { diff --git a/core/api/core.api b/core/api/core.api index 95e178503dd1..f97ab7f55f94 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -31,6 +31,7 @@ public final class dev/kord/core/Kord : kotlinx/coroutines/CoroutineScope { public final fun editSelf (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z public final fun getApplicationInfo (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun getApplicationRoleConnectionMetadataRecords (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getCache ()Ldev/kord/cache/api/DataCache; public final fun getChannel (Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun getChannel$default (Ldev/kord/core/Kord;Ldev/kord/common/entity/Snowflake;Ldev/kord/core/supplier/EntitySupplyStrategy;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; @@ -88,6 +89,7 @@ public final class dev/kord/core/Kord : kotlinx/coroutines/CoroutineScope { public final fun logout (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun shutdown (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun toString ()Ljava/lang/String; + public final fun updateApplicationRoleConnectionMetadataRecords (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun with (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/supplier/EntitySupplier; } @@ -2530,9 +2532,9 @@ public final class dev/kord/core/cache/data/ApplicationCommandSubcommandData$Com public final class dev/kord/core/cache/data/ApplicationData : dev/kord/core/cache/data/BaseApplicationData { public static final field Companion Ldev/kord/core/cache/data/ApplicationData$Companion; - public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/Snowflake; public final fun component10 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component11 ()Ljava/lang/String; @@ -2546,6 +2548,7 @@ public final class dev/kord/core/cache/data/ApplicationData : dev/kord/core/cach public final fun component19 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ljava/lang/String; public final fun component20 ()Ldev/kord/common/entity/optional/Optional; + public final fun component21 ()Ldev/kord/common/entity/optional/Optional; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; public final fun component5 ()Ldev/kord/common/entity/optional/Optional; @@ -2553,8 +2556,8 @@ public final class dev/kord/core/cache/data/ApplicationData : dev/kord/core/cach public final fun component7 ()Z public final fun component8 ()Ldev/kord/common/entity/optional/Optional; public final fun component9 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/core/cache/data/ApplicationData; - public static synthetic fun copy$default (Ldev/kord/core/cache/data/ApplicationData;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/core/cache/data/ApplicationData; + public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/core/cache/data/ApplicationData; + public static synthetic fun copy$default (Ldev/kord/core/cache/data/ApplicationData;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;ZZLdev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/core/cache/data/TeamData;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/core/cache/data/ApplicationData; public fun equals (Ljava/lang/Object;)Z public final fun getBotPublic ()Z public final fun getBotRequireCodeGrant ()Z @@ -2570,6 +2573,7 @@ public final class dev/kord/core/cache/data/ApplicationData : dev/kord/core/cach public fun getOwnerId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public fun getPrimarySkuId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public fun getPrivacyPolicyUrl ()Ldev/kord/common/entity/optional/Optional; + public fun getRoleConnectionsVerificationUrl ()Ldev/kord/common/entity/optional/Optional; public fun getRpcOrigins ()Ldev/kord/common/entity/optional/Optional; public fun getSlug ()Ldev/kord/common/entity/optional/Optional; public fun getTags ()Ldev/kord/common/entity/optional/Optional; @@ -2910,6 +2914,7 @@ public abstract interface class dev/kord/core/cache/data/BaseApplicationData { public abstract fun getOwnerId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public abstract fun getPrimarySkuId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public abstract fun getPrivacyPolicyUrl ()Ldev/kord/common/entity/optional/Optional; + public abstract fun getRoleConnectionsVerificationUrl ()Ldev/kord/common/entity/optional/Optional; public abstract fun getRpcOrigins ()Ldev/kord/common/entity/optional/Optional; public abstract fun getSlug ()Ldev/kord/common/entity/optional/Optional; public abstract fun getTags ()Ldev/kord/common/entity/optional/Optional; @@ -4494,9 +4499,9 @@ public final class dev/kord/core/cache/data/OptionData$Companion { public final class dev/kord/core/cache/data/PartialApplicationData : dev/kord/core/cache/data/BaseApplicationData { public static final field Companion Ldev/kord/core/cache/data/PartialApplicationData$Companion; - public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/Snowflake; public final fun component10 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component11 ()Ldev/kord/common/entity/optional/OptionalSnowflake; @@ -4506,6 +4511,7 @@ public final class dev/kord/core/cache/data/PartialApplicationData : dev/kord/co public final fun component15 ()Ldev/kord/common/entity/optional/Optional; public final fun component16 ()Ldev/kord/common/entity/optional/Optional; public final fun component17 ()Ldev/kord/common/entity/optional/Optional; + public final fun component18 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; @@ -4514,8 +4520,8 @@ public final class dev/kord/core/cache/data/PartialApplicationData : dev/kord/co public final fun component7 ()Ldev/kord/common/entity/optional/Optional; public final fun component8 ()Ldev/kord/common/entity/optional/OptionalSnowflake; public final fun component9 ()Ljava/lang/String; - public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/core/cache/data/PartialApplicationData; - public static synthetic fun copy$default (Ldev/kord/core/cache/data/PartialApplicationData;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/core/cache/data/PartialApplicationData; + public final fun copy (Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/core/cache/data/PartialApplicationData; + public static synthetic fun copy$default (Ldev/kord/core/cache/data/PartialApplicationData;Ldev/kord/common/entity/Snowflake;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalSnowflake;Ljava/lang/String;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/core/cache/data/PartialApplicationData; public fun equals (Ljava/lang/Object;)Z public fun getCoverImage ()Ldev/kord/common/entity/optional/Optional; public fun getCustomInstallUrl ()Ldev/kord/common/entity/optional/Optional; @@ -4529,6 +4535,7 @@ public final class dev/kord/core/cache/data/PartialApplicationData : dev/kord/co public fun getOwnerId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public fun getPrimarySkuId ()Ldev/kord/common/entity/optional/OptionalSnowflake; public fun getPrivacyPolicyUrl ()Ldev/kord/common/entity/optional/Optional; + public fun getRoleConnectionsVerificationUrl ()Ldev/kord/common/entity/optional/Optional; public fun getRpcOrigins ()Ldev/kord/common/entity/optional/Optional; public fun getSlug ()Ldev/kord/common/entity/optional/Optional; public fun getTags ()Ldev/kord/common/entity/optional/Optional; @@ -5903,6 +5910,7 @@ public abstract class dev/kord/core/entity/BaseApplication : dev/kord/core/entit public final fun getOwnerOrNull (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getPrimarySkuId ()Ldev/kord/common/entity/Snowflake; public final fun getPrivacyPolicyUrl ()Ljava/lang/String; + public final fun getRoleConnectionsVerificationUrl ()Ljava/lang/String; public final fun getRpcOrigins ()Ljava/util/List; public final fun getSlug ()Ljava/lang/String; public final fun getSupplier ()Ldev/kord/core/supplier/EntitySupplier; @@ -7375,6 +7383,19 @@ public final class dev/kord/core/entity/application/ApplicationCommandPermission public final fun getPermissions ()Lkotlinx/coroutines/flow/Flow; } +public final class dev/kord/core/entity/application/ApplicationRoleConnectionMetadata : dev/kord/core/KordObject { + public fun (Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata;Ldev/kord/core/Kord;)V + public final fun getData ()Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata; + public final fun getDescription ()Ljava/lang/String; + public final fun getDescriptionLocalizations ()Ljava/util/Map; + public final fun getKey ()Ljava/lang/String; + public fun getKord ()Ldev/kord/core/Kord; + public final fun getName ()Ljava/lang/String; + public final fun getNameLocalizations ()Ljava/util/Map; + public final fun getType ()Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType; + public fun toString ()Ljava/lang/String; +} + public abstract interface class dev/kord/core/entity/application/ChatInputCommandCommand : dev/kord/core/behavior/ChatInputCommandBehavior, dev/kord/core/entity/application/ApplicationCommand { public abstract fun getDescription ()Ljava/lang/String; public abstract fun getDescriptionLocalizations ()Ljava/util/Map; diff --git a/core/src/commonMain/kotlin/Kord.kt b/core/src/commonMain/kotlin/Kord.kt index 627861a0f5c2..0ca44fd11850 100644 --- a/core/src/commonMain/kotlin/Kord.kt +++ b/core/src/commonMain/kotlin/Kord.kt @@ -25,6 +25,7 @@ import dev.kord.core.supplier.* import dev.kord.gateway.Gateway import dev.kord.gateway.builder.LoginBuilder import dev.kord.gateway.builder.PresenceBuilder +import dev.kord.rest.builder.application.ApplicationRoleConnectionMetadataRecordsBuilder import dev.kord.rest.builder.guild.GuildCreateBuilder import dev.kord.rest.builder.interaction.* import dev.kord.rest.builder.user.CurrentUserModifyBuilder @@ -145,6 +146,30 @@ public class Kord( public suspend fun getApplicationInfo(): Application = with(EntitySupplyStrategy.rest).getApplicationInfo() + /** + * Requests the [ApplicationRoleConnectionMetadata] objects for this [Application]. + * + * @throws RestRequestException if something went wrong during the request. + */ + public suspend fun getApplicationRoleConnectionMetadataRecords(): List = + rest.applicationRoleConnectionMetadata + .getApplicationRoleConnectionMetadataRecords(selfId) + .map { ApplicationRoleConnectionMetadata(data = it, kord = this) } + + /** + * Requests to update the [ApplicationRoleConnectionMetadata] objects for this [Application]. + * + * @throws RestRequestException if something went wrong during the request. + */ + public suspend inline fun updateApplicationRoleConnectionMetadataRecords( + builder: ApplicationRoleConnectionMetadataRecordsBuilder.() -> Unit, + ): List { + contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) } + return rest.applicationRoleConnectionMetadata + .updateApplicationRoleConnectionMetadataRecords(selfId, builder) + .map { ApplicationRoleConnectionMetadata(data = it, kord = this) } + } + /** * Requests to create a new Guild configured through the [builder]. * diff --git a/core/src/commonMain/kotlin/cache/data/ApplicationData.kt b/core/src/commonMain/kotlin/cache/data/ApplicationData.kt index 6cffd5acfdab..d961b35be6dc 100644 --- a/core/src/commonMain/kotlin/cache/data/ApplicationData.kt +++ b/core/src/commonMain/kotlin/cache/data/ApplicationData.kt @@ -24,6 +24,7 @@ public sealed interface BaseApplicationData { public val tags: Optional> public val installParams: Optional public val customInstallUrl: Optional + public val roleConnectionsVerificationUrl: Optional } @Serializable @@ -48,6 +49,7 @@ public data class ApplicationData( override val tags: Optional> = Optional.Missing(), override val installParams: Optional = Optional.Missing(), override val customInstallUrl: Optional = Optional.Missing(), + override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), ) : BaseApplicationData { public companion object { @@ -73,6 +75,7 @@ public data class ApplicationData( tags, installParams, customInstallUrl, + roleConnectionsVerificationUrl, ) } } @@ -98,6 +101,7 @@ public data class PartialApplicationData( override val tags: Optional> = Optional.Missing(), override val installParams: Optional = Optional.Missing(), override val customInstallUrl: Optional = Optional.Missing(), + override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), ) : BaseApplicationData { public companion object { @@ -120,6 +124,7 @@ public data class PartialApplicationData( tags, installParams, customInstallUrl, + roleConnectionsVerificationUrl, ) } } diff --git a/core/src/commonMain/kotlin/entity/Application.kt b/core/src/commonMain/kotlin/entity/Application.kt index bd7adb7f06a1..7bbbc522aa88 100644 --- a/core/src/commonMain/kotlin/entity/Application.kt +++ b/core/src/commonMain/kotlin/entity/Application.kt @@ -69,6 +69,12 @@ public sealed class BaseApplication( /** The application's default custom authorization link, if enabled. */ public val customInstallUrl: String? get() = data.customInstallUrl.value + /** + * The application's role connection verification entry point, which when configured will render the app as a + * verification method in the guild role verification configuration. + */ + public val roleConnectionsVerificationUrl: String? get() = data.roleConnectionsVerificationUrl.value + public suspend fun getOwnerOrNull(): User? = ownerId?.let { supplier.getUserOrNull(it) } diff --git a/core/src/commonMain/kotlin/entity/application/ApplicationRoleConnectionMetadata.kt b/core/src/commonMain/kotlin/entity/application/ApplicationRoleConnectionMetadata.kt new file mode 100644 index 000000000000..13edb858d96f --- /dev/null +++ b/core/src/commonMain/kotlin/entity/application/ApplicationRoleConnectionMetadata.kt @@ -0,0 +1,49 @@ +package dev.kord.core.entity.application + +import dev.kord.common.Locale +import dev.kord.common.entity.ApplicationRoleConnectionMetadataType +import dev.kord.common.entity.DiscordApplicationRoleConnectionMetadata +import dev.kord.core.Kord +import dev.kord.core.KordObject +import dev.kord.core.entity.Application +import dev.kord.core.entity.Guild + +/** + * A representation of role connection metadata for an [Application]. + * + * When a [Guild] has added a bot and that bot has configured its + * [roleConnectionsVerificationUrl][Application.roleConnectionsVerificationUrl] (in the developer portal), the + * application will render as a potential verification method in the guild's role verification configuration. + * + * If an application has configured role connection metadata, its metadata will appear in the role verification + * configuration when the application has been added as a verification method to the role. + * + * When a user connects their account using the bot's + * [roleConnectionsVerificationUrl][Application.roleConnectionsVerificationUrl], the bot will update a user's role + * connection with metadata using the OAuth2 `role_connections.write` scope. + */ +public class ApplicationRoleConnectionMetadata( + public val data: DiscordApplicationRoleConnectionMetadata, + override val kord: Kord, +) : KordObject { + + /** The [type][ApplicationRoleConnectionMetadataType] of metadata value. */ + public val type: ApplicationRoleConnectionMetadataType get() = data.type + + /** The dictionary key for the metadata field. */ + public val key: String get() = data.key + + /** The name of the metadata field. */ + public val name: String get() = data.name + + /** The translations of the [name]. */ + public val nameLocalizations: Map get() = data.nameLocalizations.value ?: emptyMap() + + /** The description of the metadata field. */ + public val description: String get() = data.description + + /** The translations of the [description]. */ + public val descriptionLocalizations: Map get() = data.descriptionLocalizations.value ?: emptyMap() + + override fun toString(): String = "ApplicationRoleConnectionMetadata(data=$data, kord=$kord)" +} diff --git a/rest/api/rest.api b/rest/api/rest.api index e929bfd92bad..4f7028c6b14f 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -82,6 +82,36 @@ public abstract interface class dev/kord/rest/builder/RequestBuilder { public abstract fun toRequest ()Ljava/lang/Object; } +public final class dev/kord/rest/builder/application/ApplicationRoleConnectionMetadataBuilder : dev/kord/rest/builder/RequestBuilder, dev/kord/rest/builder/interaction/LocalizedDescriptionCreateBuilder, dev/kord/rest/builder/interaction/LocalizedNameCreateBuilder { + public fun (Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + public fun description (Ldev/kord/common/Locale;Ljava/lang/String;)V + public fun getDescription ()Ljava/lang/String; + public fun getDescriptionLocalizations ()Ljava/util/Map; + public final fun getKey ()Ljava/lang/String; + public fun getName ()Ljava/lang/String; + public fun getNameLocalizations ()Ljava/util/Map; + public final fun getType ()Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType; + public fun name (Ldev/kord/common/Locale;Ljava/lang/String;)V + public fun setDescription (Ljava/lang/String;)V + public fun setDescriptionLocalizations (Ljava/util/Map;)V + public final fun setKey (Ljava/lang/String;)V + public fun setName (Ljava/lang/String;)V + public fun setNameLocalizations (Ljava/util/Map;)V + public final fun setType (Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType;)V + public fun toRequest ()Ldev/kord/common/entity/DiscordApplicationRoleConnectionMetadata; + public synthetic fun toRequest ()Ljava/lang/Object; +} + +public final class dev/kord/rest/builder/application/ApplicationRoleConnectionMetadataRecordsBuilder : dev/kord/rest/builder/RequestBuilder { + public fun ()V + public final fun getRecords ()Ljava/util/List; + public final fun record (Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public static synthetic fun record$default (Ldev/kord/rest/builder/application/ApplicationRoleConnectionMetadataRecordsBuilder;Ldev/kord/common/entity/ApplicationRoleConnectionMetadataType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + public final fun setRecords (Ljava/util/List;)V + public synthetic fun toRequest ()Ljava/lang/Object; + public fun toRequest ()Ljava/util/List; +} + public final class dev/kord/rest/builder/auditlog/AuditLogGetRequestBuilder : dev/kord/rest/builder/RequestBuilder { public fun ()V public final fun getAction ()Ldev/kord/common/entity/AuditLogEvent; @@ -6245,6 +6275,14 @@ public final class dev/kord/rest/route/Route$ApplicationId : dev/kord/rest/route public static final field INSTANCE Ldev/kord/rest/route/Route$ApplicationId; } +public final class dev/kord/rest/route/Route$ApplicationRoleConnectionMetadataRecordsGet : dev/kord/rest/route/Route { + public static final field INSTANCE Ldev/kord/rest/route/Route$ApplicationRoleConnectionMetadataRecordsGet; +} + +public final class dev/kord/rest/route/Route$ApplicationRoleConnectionMetadataRecordsUpdate : dev/kord/rest/route/Route { + public static final field INSTANCE Ldev/kord/rest/route/Route$ApplicationRoleConnectionMetadataRecordsUpdate; +} + public final class dev/kord/rest/route/Route$AuditLogGet : dev/kord/rest/route/Route { public static final field INSTANCE Ldev/kord/rest/route/Route$AuditLogGet; } @@ -6993,6 +7031,13 @@ public final class dev/kord/rest/route/Route$WebhookToken : dev/kord/rest/route/ public static final field INSTANCE Ldev/kord/rest/route/Route$WebhookToken; } +public final class dev/kord/rest/service/ApplicationRoleConnectionMetadataService : dev/kord/rest/service/RestService { + public fun (Ldev/kord/rest/request/RequestHandler;)V + public final fun getApplicationRoleConnectionMetadataRecords (Ldev/kord/common/entity/Snowflake;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun updateApplicationRoleConnectionMetadataRecords (Ldev/kord/common/entity/Snowflake;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun updateApplicationRoleConnectionMetadataRecords (Ldev/kord/common/entity/Snowflake;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + public final class dev/kord/rest/service/ApplicationService : dev/kord/rest/service/RestService { public fun (Ldev/kord/rest/request/RequestHandler;)V public final fun getCurrentApplicationInfo (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -7295,6 +7340,7 @@ public final class dev/kord/rest/service/InviteService : dev/kord/rest/service/R public final class dev/kord/rest/service/RestClient : dev/kord/rest/service/RestService { public fun (Ldev/kord/rest/request/RequestHandler;)V public final fun getApplication ()Ldev/kord/rest/service/ApplicationService; + public final fun getApplicationRoleConnectionMetadata ()Ldev/kord/rest/service/ApplicationRoleConnectionMetadataService; public final fun getAuditLog ()Ldev/kord/rest/service/AuditLogService; public final fun getAutoModeration ()Ldev/kord/rest/service/AutoModerationService; public final fun getChannel ()Ldev/kord/rest/service/ChannelService; diff --git a/rest/src/commonMain/kotlin/builder/application/ApplicationRoleConnectionMetadata.kt b/rest/src/commonMain/kotlin/builder/application/ApplicationRoleConnectionMetadata.kt new file mode 100644 index 000000000000..9f923f85cf05 --- /dev/null +++ b/rest/src/commonMain/kotlin/builder/application/ApplicationRoleConnectionMetadata.kt @@ -0,0 +1,72 @@ +package dev.kord.rest.builder.application + +import dev.kord.common.Locale +import dev.kord.common.annotation.KordDsl +import dev.kord.common.entity.ApplicationRoleConnectionMetadataType +import dev.kord.common.entity.DiscordApplicationRoleConnectionMetadata +import dev.kord.common.entity.optional.Optional +import dev.kord.common.entity.optional.delegate.delegate +import dev.kord.common.entity.optional.mapCopy +import dev.kord.rest.builder.RequestBuilder +import dev.kord.rest.builder.interaction.LocalizedDescriptionCreateBuilder +import dev.kord.rest.builder.interaction.LocalizedNameCreateBuilder +import kotlin.contracts.InvocationKind.EXACTLY_ONCE +import kotlin.contracts.contract + +@KordDsl +public class ApplicationRoleConnectionMetadataRecordsBuilder : + RequestBuilder> { + + public var records: MutableList = mutableListOf() + + /** + * Adds a configured [ApplicationRoleConnectionMetadataBuilder] to [records]. + * + * @param type The [type][ApplicationRoleConnectionMetadataType] of metadata value. + * @param key The dictionary key for the metadata field (must be `a-z`, `0-9`, or `_` characters; 1-50 characters). + * @param name The name of the metadata field (1-100 characters). + * @param description The description of the metadata field (1-200 characters). + */ + public inline fun record( + type: ApplicationRoleConnectionMetadataType, + key: String, + name: String, + description: String, + builder: ApplicationRoleConnectionMetadataBuilder.() -> Unit = {}, + ) { + contract { callsInPlace(builder, EXACTLY_ONCE) } + records += ApplicationRoleConnectionMetadataBuilder(type, key, name, description).apply(builder) + } + + override fun toRequest(): List = records.map { it.toRequest() } +} + +@KordDsl +public class ApplicationRoleConnectionMetadataBuilder( + /** The [type][ApplicationRoleConnectionMetadataType] of metadata value. */ + public var type: ApplicationRoleConnectionMetadataType, + /** The dictionary key for the metadata field (must be `a-z`, `0-9`, or `_` characters; 1-50 characters). */ + public var key: String, + /** The name of the metadata field (1-100 characters). */ + override var name: String, + /** The description of the metadata field (1-200 characters). */ + override var description: String +) : RequestBuilder, + LocalizedNameCreateBuilder, + LocalizedDescriptionCreateBuilder { + + private var _nameLocalizations: Optional> = Optional.Missing() + override var nameLocalizations: MutableMap? by ::_nameLocalizations.delegate() + + private var _descriptionLocalizations: Optional> = Optional.Missing() + override var descriptionLocalizations: MutableMap? by ::_descriptionLocalizations.delegate() + + override fun toRequest(): DiscordApplicationRoleConnectionMetadata = DiscordApplicationRoleConnectionMetadata( + type = type, + key = key, + name = name, + nameLocalizations = _nameLocalizations.mapCopy(), + description = description, + descriptionLocalizations = _descriptionLocalizations.mapCopy(), + ) +} diff --git a/rest/src/commonMain/kotlin/route/Route.kt b/rest/src/commonMain/kotlin/route/Route.kt index a83f07f81e69..eb2e6a0eb3c8 100644 --- a/rest/src/commonMain/kotlin/route/Route.kt +++ b/rest/src/commonMain/kotlin/route/Route.kt @@ -110,6 +110,26 @@ public sealed class Route( Route(HttpMethod.Get, "/gateway/bot", BotGatewayResponse.serializer()) + /* + * Application Role Connection Metadata: + * https://discord.com/developers/docs/resources/application-role-connection-metadata + */ + + public object ApplicationRoleConnectionMetadataRecordsGet : + Route>( + HttpMethod.Get, + "/applications/$ApplicationId/role-connections/metadata", + ListSerializer(DiscordApplicationRoleConnectionMetadata.serializer()), + ) + + public object ApplicationRoleConnectionMetadataRecordsUpdate : + Route>( + HttpMethod.Put, + "/applications/$ApplicationId/role-connections/metadata", + ListSerializer(DiscordApplicationRoleConnectionMetadata.serializer()), + ) + + /* * Audit Log: * https://discord.com/developers/docs/resources/audit-log diff --git a/rest/src/commonMain/kotlin/service/ApplicationRoleConnectionMetadataService.kt b/rest/src/commonMain/kotlin/service/ApplicationRoleConnectionMetadataService.kt new file mode 100644 index 000000000000..55b22cea2334 --- /dev/null +++ b/rest/src/commonMain/kotlin/service/ApplicationRoleConnectionMetadataService.kt @@ -0,0 +1,36 @@ +package dev.kord.rest.service + +import dev.kord.common.entity.DiscordApplicationRoleConnectionMetadata +import dev.kord.common.entity.Snowflake +import dev.kord.rest.builder.application.ApplicationRoleConnectionMetadataRecordsBuilder +import dev.kord.rest.request.RequestHandler +import dev.kord.rest.route.Route +import kotlinx.serialization.builtins.ListSerializer +import kotlin.contracts.InvocationKind.EXACTLY_ONCE +import kotlin.contracts.contract + +public class ApplicationRoleConnectionMetadataService(requestHandler: RequestHandler) : RestService(requestHandler) { + + public suspend fun getApplicationRoleConnectionMetadataRecords( + applicationId: Snowflake, + ): List = call(Route.ApplicationRoleConnectionMetadataRecordsGet) { + keys[Route.ApplicationId] = applicationId + } + + public suspend fun updateApplicationRoleConnectionMetadataRecords( + applicationId: Snowflake, + request: List, + ): List = call(Route.ApplicationRoleConnectionMetadataRecordsUpdate) { + keys[Route.ApplicationId] = applicationId + body(ListSerializer(DiscordApplicationRoleConnectionMetadata.serializer()), request) + } + + public suspend inline fun updateApplicationRoleConnectionMetadataRecords( + applicationId: Snowflake, + builder: ApplicationRoleConnectionMetadataRecordsBuilder.() -> Unit, + ): List { + contract { callsInPlace(builder, EXACTLY_ONCE) } + val request = ApplicationRoleConnectionMetadataRecordsBuilder().apply(builder).toRequest() + return updateApplicationRoleConnectionMetadataRecords(applicationId, request) + } +} diff --git a/rest/src/commonMain/kotlin/service/RestClient.kt b/rest/src/commonMain/kotlin/service/RestClient.kt index 3316c54c6345..66f82abf8db1 100644 --- a/rest/src/commonMain/kotlin/service/RestClient.kt +++ b/rest/src/commonMain/kotlin/service/RestClient.kt @@ -17,6 +17,8 @@ public class RestClient(requestHandler: RequestHandler) : RestService(requestHan public val interaction: InteractionService = InteractionService(requestHandler) // resources + public val applicationRoleConnectionMetadata: ApplicationRoleConnectionMetadataService = + ApplicationRoleConnectionMetadataService(requestHandler) public val auditLog: AuditLogService = AuditLogService(requestHandler) public val autoModeration: AutoModerationService = AutoModerationService(requestHandler) public val channel: ChannelService = ChannelService(requestHandler)