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

chore: promote ads scheduler api out of beta #906

Merged
merged 1 commit into from Jan 12, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -20,9 +20,9 @@
public class ChannelAdBreakBeginEvent extends EventSubChannelEvent {

/**
* Length in seconds of the mid-roll ad break requested
* Length in seconds of the mid-roll ad break requested.
*/
@JsonAlias("duration") // https://github.com/twitchdev/issues/issues/850
@JsonAlias({"duration", "duration_seconds"}) // https://github.com/twitchdev/issues/issues/850
private Integer lengthSeconds;

/**
Expand All @@ -35,7 +35,7 @@ public class ChannelAdBreakBeginEvent extends EventSubChannelEvent {
private Instant startedAt;

/**
* Indicates if the ad was automatically scheduled via Ads Manager
* Indicates if the ad was automatically scheduled via Ads Manager.
*/
@Accessors(fluent = true)
@JsonProperty("is_automatic")
Expand All @@ -47,4 +47,14 @@ public class ChannelAdBreakBeginEvent extends EventSubChannelEvent {
*/
private String requesterUserId;

/**
* The login of the user that requested the ad.
*/
private String requesterUserLogin;

/**
* The display name of the user that requested the ad.
*/
private String requesterUserName;

}
Expand Up @@ -2,7 +2,6 @@

import com.github.twitch4j.eventsub.condition.ChannelAdBreakCondition;
import com.github.twitch4j.eventsub.events.ChannelAdBreakBeginEvent;
import org.jetbrains.annotations.ApiStatus;

/**
* The channel.ad_break.begin subscription type sends a notification when a user runs a midroll commercial break,
Expand All @@ -12,16 +11,15 @@
*
* @see com.github.twitch4j.auth.domain.TwitchScopes#HELIX_CHANNEL_ADS_READ
*/
@ApiStatus.Experimental
public class BetaChannelAdBreakBeginType implements SubscriptionType<ChannelAdBreakCondition, ChannelAdBreakCondition.ChannelAdBreakConditionBuilder<?, ?>, ChannelAdBreakBeginEvent> {
public class ChannelAdBreakBeginType implements SubscriptionType<ChannelAdBreakCondition, ChannelAdBreakCondition.ChannelAdBreakConditionBuilder<?, ?>, ChannelAdBreakBeginEvent> {
@Override
public String getName() {
return "channel.ad_break.begin";
}

@Override
public String getVersion() {
return "beta";
return "1";
}

@Override
Expand Down
Expand Up @@ -14,7 +14,7 @@
public class SubscriptionTypes {
private final Map<String, SubscriptionType<?, ?, ?>> SUBSCRIPTION_TYPES;

public final @ApiStatus.Experimental BetaChannelAdBreakBeginType BETA_CHANNEL_AD_BREAK_BEGIN;
public final ChannelAdBreakBeginType CHANNEL_AD_BREAK_BEGIN;
public final ChannelBanType CHANNEL_BAN;
public final ChannelChatClearType CHANNEL_CHAT_CLEAR;
public final ChannelClearUserMessagesType CHANNEL_CLEAR_USER_MESSAGES;
Expand Down Expand Up @@ -74,7 +74,7 @@ public class SubscriptionTypes {
static {
SUBSCRIPTION_TYPES = Collections.unmodifiableMap(
Stream.of(
BETA_CHANNEL_AD_BREAK_BEGIN = new BetaChannelAdBreakBeginType(),
CHANNEL_AD_BREAK_BEGIN = new ChannelAdBreakBeginType(),
CHANNEL_BAN = new ChannelBanType(),
CHANNEL_CHAT_CLEAR = new ChannelChatClearType(),
CHANNEL_CLEAR_USER_MESSAGES = new ChannelClearUserMessagesType(),
Expand Down
Expand Up @@ -1210,7 +1210,6 @@ HystrixCommand<SoundtrackPlaylistMetadataList> getSoundtrackPlaylists(
* @return {@link AdScheduleWrapper}
* @see com.github.twitch4j.auth.domain.TwitchScopes#HELIX_CHANNEL_ADS_READ
*/
@ApiStatus.Experimental // in open beta
@RequestLine("GET /channels/ads?broadcaster_id={broadcaster_id}")
@Headers("Authorization: Bearer {token}")
HystrixCommand<AdScheduleWrapper> getAdSchedule(
Expand All @@ -1232,7 +1231,6 @@ HystrixCommand<AdScheduleWrapper> getAdSchedule(
* @return {@link SnoozedAdWrapper}
* @see com.github.twitch4j.auth.domain.TwitchScopes#HELIX_CHANNEL_ADS_MANAGE
*/
@ApiStatus.Experimental // in open beta
@RequestLine("POST /channels/ads/schedule/snooze?broadcaster_id={broadcaster_id}")
@Headers("Authorization: Bearer {token}")
HystrixCommand<SnoozedAdWrapper> snoozeNextAd(
Expand Down
@@ -1,5 +1,6 @@
package com.github.twitch4j.helix.domain;

import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;
Expand Down Expand Up @@ -28,12 +29,14 @@ public class AdSchedule {
/**
* The length in seconds of the scheduled upcoming ad break.
*/
@JsonAlias({"duration", "duration_seconds"})
private Integer lengthSeconds;

/**
* The amount of pre-roll free time remaining for the channel in seconds.
* Returns 0 if they are currently not pre-roll free.
*/
@JsonAlias("preroll_free_time")
private Integer prerollFreeTimeSeconds;

/**
Expand Down