/
AuditLogKey.java
337 lines (291 loc) · 11.7 KB
/
AuditLogKey.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
/*
* Copyright 2015-2017 Austin Keener & Michael Ritter & Florian Spieß
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.dv8tion.jda.core.audit;
/**
* Enum of possible/expected keys that can be provided
* to {@link AuditLogEntry#getChangeByKey(AuditLogKey) AuditLogEntry.getChangeByKey(AuditLogEntry.AuditLogKey}.
*
* <p>Each constant in this enum has elaborate documentation on expected values for the
* returned {@link AuditLogChange AuditLogChange}.
* <br>There is no guarantee that the resulting type is accurate or that the value selected is not {@code null}!
*/
public enum AuditLogKey
{
/**
* This is sometimes visible for {@link ActionType ActionTypes}
* which create a new entity.
* <br>Use with designated {@code getXById} method.
*
* <p>Expected type: <b>String</b>
*/
ID("id"),
// GUILD
/**
* Change for the {@link net.dv8tion.jda.core.entities.Guild#getName() Guild.getName()} value
*
* <p>Expected type: <b>String</b>
*/
GUILD_NAME("name"),
/**
* Change of User ID for the owner of a {@link net.dv8tion.jda.core.entities.Guild Guild}
*
* <p>Expected type: <b>String</b>
*/
GUILD_OWNER("owner_id"),
/**
* Change of region represented by a key.
* <br>Use with {@link net.dv8tion.jda.core.Region#fromKey(String) Region.fromKey(String)}
*
* <p>Expected type: <b>String</b>
*/
GUILD_REGION("region"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Guild.Timeout AFKTimeout} of a Guild.
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild.Timeout#fromKey(int) Timeout.fromKey(int)}
*
* <p>Expected type: <b>Integer</b>
*/
GUILD_AFK_TIMEOUT("afk_timeout"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Guild#getAfkChannel() Guild.getAfkChannel()} value represented by a VoiceChannel ID.
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild#getVoiceChannelById(String)
* Guild.getVoiceChannelById(String)}
*
* <p>Expected type: <b>String</b>
*/
GUILD_AFK_CHANNEL("afk_channel_id"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Guild#getExplicitContentLevel() Guild.getExplicitContentLevel()} of a Guild.
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild.ExplicitContentLevel#fromKey(int) Guild.ExplicitContentLevel.fromKey(int)}
*
* <p>Expected type: <b>Integer</b>
*/
GUILD_EXPLICIT_CONTENT_FILTER("explicit_content_filter"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Guild#getIconId() Icon ID} of a Guild.
*
* <p>Expected type: <b>String</b>
*/
GUILD_ICON("icon"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Guild#getSplashId() Splash ID} of a Guild.
*
* <p>Expected type: <b>String</b>
*/
GUILD_SPLASH("splash"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Guild#getVerificationLevel() Guild.getVerificationLevel()} value.
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild.VerificationLevel#fromKey(int) Guild.VerificationLevel.fromKey(int)}
*
* <p>Expected type: <b>Integer</b>
*/
GUILD_VERIFICATION_LEVEL("verification_level"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Guild#getDefaultNotificationLevel() Guild.getDefaultNotificationLevel()} value.
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild.NotificationLevel#fromKey(int) Guild.NotificationLevel.fromKey(int)}
*
* <p>Expected type: <b>Integer</b>
*/
GUILD_NOTIFICATION_LEVEL("default_message_notifications"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Guild#getRequiredMFALevel() Guild.getRequiredMFALevel()} value
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild.MFALevel#fromKey(int) Guild.MFALevel.fromKey(int)}
*
* <p>Expected type: <b>Integer</b>
*/
GUILD_MFA_LEVEL("mfa_level"),
// CHANNEL
/**
* Change of the {@link net.dv8tion.jda.core.entities.Channel#getName() Channel.getName()} value.
*
* <p>Expected type: <b>String</b>
*/
CHANNEL_NAME("name"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.TextChannel#getTopic() TextChannel.getTopic()} value.
* <br>Only for {@link net.dv8tion.jda.core.entities.ChannelType#TEXT ChannelType.TEXT}
*
* <p>Expected type: <b>String</b>
*/
CHANNEL_TOPIC("topic"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.VoiceChannel#getBitrate() VoiceChannel.getBitrate()} value.
* <br>Only for {@link net.dv8tion.jda.core.entities.ChannelType#VOICE ChannelType.VOICE}
*
* <p>Expected type: <b>Integer</b>
*/
CHANNEL_BITRATE("bitrate"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.VoiceChannel#getUserLimit() VoiceChannel.getUserLimit()} value.
* <br>Only for {@link net.dv8tion.jda.core.entities.ChannelType#VOICE ChannelType.VOICE}
*
* <p>Expected type: <b>Integer</b>
*/
CHANNEL_USER_LIMIT("user_limit"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.TextChannel#getNSFW() TextChannel.getNSFW()} value.
* <br>Only for {@link net.dv8tion.jda.core.entities.ChannelType#TEXT ChannelType.TEXT}
*
* <p>Expected type: <b>Boolean</b>
*/
CHANNEL_NSFW("nsfw"),
// MEMBER
/**
* Change of the {@link net.dv8tion.jda.core.entities.Member#getNickname() Member.getNickname()} value
*
* <p>Expected type: <b>String</b>
*/
MEMBER_NICK("nick"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Member#getVoiceState() GuildVoiceState} of a Member.
* <br>Indicating that the {@link net.dv8tion.jda.core.entities.GuildVoiceState#isGuildMuted() Guild.isGuildMuted()} value updated.
*
* <p>Expected type: <b>Boolean</b>
*/
MEMBER_MUTE("mute"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Member#getVoiceState() GuildVoiceState} of a Member.
* <br>Indicating that the {@link net.dv8tion.jda.core.entities.GuildVoiceState#isGuildDeafened() Guild.isGuildDeafened()} value updated.
*
* <p>Expected type: <b>Boolean</b>
*/
MEMBER_DEAF("deaf"),
/**
* Roles added to {@link net.dv8tion.jda.core.entities.Member#getRoles() Member.getRoles()} with this action
* <br>Containing a list of {@link net.dv8tion.jda.core.entities.Role Role} IDs
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild#getRoleById(String) Guild.getRoleById(String)}
*
* <p>Expected type: <b>List{@literal <String>}</b>
*/
MEMBER_ROLES_ADD("$add"),
/**
* Roles removed from {@link net.dv8tion.jda.core.entities.Member#getRoles() Member.getRoles()} with this action
* <br>Containing a list of {@link net.dv8tion.jda.core.entities.Role Role} IDs
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild#getRoleById(String) Guild.getRoleById(String)}
*
* <p>Expected type: <b>List{@literal <String>}</b>
*/
MEMBER_ROLES_REMOVE("$remove"),
// PERMISSION OVERRIDE
/**
* Modified raw denied permission bits
* <br>Similar to the value returned by {@link net.dv8tion.jda.core.entities.PermissionOverride#getDeniedRaw() PermissionOverride.getDeniedRaw()}
* <br>Use with {@link net.dv8tion.jda.core.Permission#getPermissions(long) Permission.getPermissions(long)}
*
* <p>Expected type: <b>Long</b>
*/
OVERRIDE_DENY("deny"),
/**
* Modified raw allowed permission bits
* <br>Similar to the value returned by {@link net.dv8tion.jda.core.entities.PermissionOverride#getAllowedRaw() PermissionOverride.getAllowedRaw()}
* <br>Use with {@link net.dv8tion.jda.core.Permission#getPermissions(long) Permission.getPermissions(long)}
*
* <p>Expected type: <b>Long</b>
*/
OVERRIDE_ALLOW("allow"),
// ROLE
/**
* Change of the {@link net.dv8tion.jda.core.entities.Role#getName() Role.getName()} value.
*
* <p>Expected type: <b>String</b>
*/
ROLE_NAME("name"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Role#getPermissionsRaw() Role.getPermissionsRaw()} value.
* <br>Use with {@link net.dv8tion.jda.core.Permission#getPermissions(long) Permission.getPermissions(long)}
*
* <p>Expected type: <b>Long</b>
*/
ROLE_PERMISSIONS("permissions"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Role#getColor() Role.getColor()} value.
* <br>Use with {@link java.awt.Color#Color(int) Color(int)}
*
* <p>Expected type: <b>Integer</b>
*/
ROLE_COLOR("color"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Role#isHoisted() Role.isHoisted()} value.
*
* <p>Expected type: <b>Boolean</b>
*/
ROLE_HOISTED("hoisted"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Role#isMentionable() Role.isMentionable()} value.
*
* <p>Expected type: <b>Boolean</b>
*/
ROLE_MENTIONABLE("mentionable"),
// EMOTE
/**
* Change of the {@link net.dv8tion.jda.core.entities.Emote#getName() Emote.getName()} value.
*
* <p>Expected type: <b>String</b>
*/
EMOTE_NAME("name"),
/**
* Roles added to {@link net.dv8tion.jda.core.entities.Emote#getRoles() Emote.getRoles()} with this action
* <br>Containing a list of {@link net.dv8tion.jda.core.entities.Role Role} IDs
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild#getRoleById(String) Guild.getRoleById(String)}
*
* <p>Expected type: <b>List{@literal <String>}</b>
*/
EMOTE_ROLES_ADD("$add"),
/**
* Roles remove from {@link net.dv8tion.jda.core.entities.Emote#getRoles() Emote.getRoles()} with this action
* <br>Containing a list of {@link net.dv8tion.jda.core.entities.Role Role} IDs
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild#getRoleById(String) Guild.getRoleById(String)}
*
* <p>Expected type: <b>List{@literal <String>}</b>
*/
EMOTE_ROLES_REMOVE("$remove"),
// WEBHOOK
/**
* Change of the {@link net.dv8tion.jda.core.entities.Webhook#getName() Webhook.getName()} value.
*
* <p>Expected type: <b>String</b>
*/
WEBHOOK_NAME("name"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Webhook#getDefaultUser() Webhook.getDefaultUser()}'s avatar hash of a Webhook.
* <br>This is used to build the {@link net.dv8tion.jda.core.entities.User#getAvatarUrl() User.getAvatarUrl()}!
*
* <p>Expected type: <b>String</b>
*/
WEBHOOK_ICON("avatar_hash"),
/**
* Change of the {@link net.dv8tion.jda.core.entities.Webhook#getChannel() Webhook.getChannel()} for
* the target {@link net.dv8tion.jda.core.entities.Webhook Webhook}
* <br>Use with {@link net.dv8tion.jda.core.entities.Guild#getTextChannelById(String) Guild.getTextChannelById(String)}
*
* <p>Expected type: <b>String</b>
*/
WEBHOOK_CHANNEL("channel_id");
private final String key;
AuditLogKey(String key)
{
this.key = key;
}
public String getKey()
{
return key;
}
@Override
public String toString()
{
return name() + '(' + key + ')';
}
}