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

Add after to audit log get #745

Merged
merged 1 commit into from
Feb 16, 2023
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
14 changes: 9 additions & 5 deletions rest/api/rest.api
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ public abstract interface class dev/kord/rest/builder/RequestBuilder {
public final class dev/kord/rest/builder/auditlog/AuditLogGetRequestBuilder : dev/kord/rest/builder/RequestBuilder {
public fun <init> ()V
public final fun getAction ()Ldev/kord/common/entity/AuditLogEvent;
public final fun getAfter ()Ldev/kord/common/entity/Snowflake;
public final fun getBefore ()Ldev/kord/common/entity/Snowflake;
public final fun getLimit ()Ljava/lang/Integer;
public final fun getUserId ()Ldev/kord/common/entity/Snowflake;
public final fun setAction (Ldev/kord/common/entity/AuditLogEvent;)V
public final fun setAfter (Ldev/kord/common/entity/Snowflake;)V
public final fun setBefore (Ldev/kord/common/entity/Snowflake;)V
public final fun setLimit (Ljava/lang/Integer;)V
public final fun setUserId (Ldev/kord/common/entity/Snowflake;)V
Expand Down Expand Up @@ -2449,16 +2451,18 @@ public final class dev/kord/rest/json/request/ApplicationCommandModifyRequest$Co

public final class dev/kord/rest/json/request/AuditLogGetRequest {
public fun <init> ()V
public fun <init> (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/AuditLogEvent;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;)V
public synthetic fun <init> (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/AuditLogEvent;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/AuditLogEvent;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;)V
public synthetic fun <init> (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/AuditLogEvent;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ldev/kord/common/entity/Snowflake;
public final fun component2 ()Ldev/kord/common/entity/AuditLogEvent;
public final fun component3 ()Ldev/kord/common/entity/Snowflake;
public final fun component4 ()Ljava/lang/Integer;
public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/AuditLogEvent;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;)Ldev/kord/rest/json/request/AuditLogGetRequest;
public static synthetic fun copy$default (Ldev/kord/rest/json/request/AuditLogGetRequest;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/AuditLogEvent;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;ILjava/lang/Object;)Ldev/kord/rest/json/request/AuditLogGetRequest;
public final fun component4 ()Ldev/kord/common/entity/Snowflake;
public final fun component5 ()Ljava/lang/Integer;
public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/AuditLogEvent;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;)Ldev/kord/rest/json/request/AuditLogGetRequest;
public static synthetic fun copy$default (Ldev/kord/rest/json/request/AuditLogGetRequest;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/AuditLogEvent;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ljava/lang/Integer;ILjava/lang/Object;)Ldev/kord/rest/json/request/AuditLogGetRequest;
public fun equals (Ljava/lang/Object;)Z
public final fun getAction ()Ldev/kord/common/entity/AuditLogEvent;
public final fun getAfter ()Ldev/kord/common/entity/Snowflake;
public final fun getBefore ()Ldev/kord/common/entity/Snowflake;
public final fun getLimit ()Ljava/lang/Integer;
public final fun getUserId ()Ldev/kord/common/entity/Snowflake;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class AuditLogGetRequestBuilder : RequestBuilder<AuditLogGetRequest> {
*/
public var before: Snowflake? = null

/**
* The time, represented as a Snowflake, before which entries are no longer returned.
*/
public var after: Snowflake? = null

/**
* How many entries are returned.
*
Expand All @@ -34,5 +39,5 @@ public class AuditLogGetRequestBuilder : RequestBuilder<AuditLogGetRequest> {
*/
public var limit: Int? = null

override fun toRequest(): AuditLogGetRequest = AuditLogGetRequest(userId, action, before, limit)
override fun toRequest(): AuditLogGetRequest = AuditLogGetRequest(userId, action, before, after, limit)
}
1 change: 1 addition & 0 deletions rest/src/main/kotlin/json/request/AuditLogGetRequest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public data class AuditLogGetRequest(
val userId: Snowflake? = null,
val action: AuditLogEvent? = null,
val before: Snowflake? = null,
val after: Snowflake? = null,
val limit: Int? = null,
)
1 change: 1 addition & 0 deletions rest/src/main/kotlin/service/AuditLogService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class AuditLogService(requestHandler: RequestHandler) : RestService(reque
request.userId?.let { parameter("user_id", it) }
request.action?.let { parameter("action_type", "${it.value}") }
request.before?.let { parameter("before", it) }
request.after?.let { parameter("after", it) }
request.limit?.let { parameter("limit", it) }
}
}