-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
ContentClassification.java
82 lines (68 loc) · 2.48 KB
/
ContentClassification.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
package com.github.twitch4j.eventsub.domain;
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.twitch4j.util.EnumUtil;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
/**
* Content classification tags that indicate that a stream may not be suitable for certain viewers.
*
* @see <a href="https://safety.twitch.tv/s/article/Content-Classification-Guidelines?language=en_US">Official Guidelines</a>
*/
@RequiredArgsConstructor
public enum ContentClassification {
/**
* Excessive tobacco glorification or promotion, any marijuana consumption/use,
* legal drug and alcohol induced intoxication, discussions of illegal drugs.
*/
@JsonProperty("DrugsIntoxication")
DRUGS("DrugsIntoxication"),
/**
* Participating in online or in-person gambling, poker or fantasy sports,
* that involve the exchange of real money.
*/
@JsonProperty("Gambling")
GAMBLING("Gambling"),
/**
* Games that are rated Mature or less suitable for a younger audience.
* <p>
* This tag is automatically applied based on the stream category.
*/
@JsonProperty("MatureGame")
MATURE_GAME("MatureGame"),
/**
* Prolonged, and repeated use of obscenities, profanities, and vulgarities,
* especially as a regular part of speech.
*/
@JsonProperty("ProfanityVulgarity")
PROFANITY("ProfanityVulgarity"),
/**
* Content that focuses on sexualized physical attributes and activities, sexual topics, or experiences.
*/
@JsonProperty("SexualThemes")
SEXUAL("SexualThemes"),
/**
* Simulations and/or depictions of realistic violence, gore, extreme injury, or death.
*/
@JsonProperty("ViolentGraphic")
VIOLENCE("ViolentGraphic"),
/**
* The channel has a content classification label that is unrecognized by the library;
* Please file an issue on our GitHub repository.
*/
@JsonEnumDefaultValue
UNKNOWN("Unknown");
private static final Map<String, ContentClassification> MAPPINGS = EnumUtil.buildMapping(values());
private final String twitchString;
@Override
public String toString() {
return this.twitchString;
}
@NotNull
@ApiStatus.Internal
public static ContentClassification parse(@NotNull String id) {
return MAPPINGS.getOrDefault(id, UNKNOWN);
}
}