Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add helix extension api endpoints (#529)
* feat: implement TwitchHelix#getExtensionLiveChannels * refactor: provide cursor workaround in optional wrapper * feat: implement TwitchHelix#getReleasedExtensions * feat: implement TwitchHelix#getExtensionBitsProducts * feat: implement TwitchHelix#updateExtensionBitsProduct * fix: properly create json body for updateExtensionBitsProduct * fix: extensions live pagination workaround via twitchdev/issues#524 * feat: add TwitchHelix#getExtensionSecrets * feat: add TwitchHelix#createExtensionSecret * feat: add TwitchHelix#sendExtensionChatMessage * feat: add TwitchHelix#sendExtensionPubSubMessage * feat: add TwitchHelix#setExtensionRequiredConfiguration * feat: add TwitchHelix#getExtensionConfigurationSegment * feat: add TwitchHelix#setExtensionConfigurationSegment * feat: add TwitchHelix#getExtensions * refactor: reorder helix jwt endpoints * docs: note twitch scope inconsistency with getUserExtensions * fix: make ReleasedExtension#hasChatSupport yield Boolean * chore: add more undocumented ExtensionState based on kraken * refactor: use JsonProperty in ExtensionSegment * fix: add ExtensionSegment#toString
- Loading branch information
Showing
17 changed files
with
1,001 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
rest-helix/src/main/java/com/github/twitch4j/helix/domain/ExtensionBitsProduct.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package com.github.twitch4j.helix.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.With; | ||
import lombok.experimental.Accessors; | ||
import lombok.extern.jackson.Jacksonized; | ||
|
||
import java.time.Instant; | ||
|
||
@With | ||
@Data | ||
@Setter(AccessLevel.PRIVATE) | ||
@Builder(toBuilder = true) | ||
@Jacksonized | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class ExtensionBitsProduct { | ||
|
||
/** | ||
* SKU of the Bits product. | ||
* <p> | ||
* This is unique across all products that belong to an Extension. | ||
*/ | ||
private String sku; | ||
|
||
/** | ||
* Object containing cost information. | ||
*/ | ||
private Cost cost; | ||
|
||
/** | ||
* Indicates if the product is in development and not yet released for public use. | ||
*/ | ||
@Accessors(fluent = true) | ||
@JsonProperty("in_development") | ||
private Boolean isInDevelopment; | ||
|
||
/** | ||
* Name of the product to be displayed in the Extension. | ||
*/ | ||
private String displayName; | ||
|
||
/** | ||
* Expiration time for the product in RFC3339 format. | ||
*/ | ||
private Instant expiration; | ||
|
||
/** | ||
* Indicates if Bits product purchase events are broadcast to all instances of an Extension on a channel via the “onTransactionComplete” helper callback. | ||
*/ | ||
@Accessors(fluent = true) | ||
@JsonProperty("is_broadcast") | ||
private Boolean isBroadcast; | ||
|
||
@With | ||
@Data | ||
@Setter(AccessLevel.PRIVATE) | ||
@Builder(toBuilder = true) | ||
@Jacksonized | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public static class Cost { | ||
|
||
/** | ||
* Number of Bits for which the product will be exchanged. | ||
*/ | ||
private Integer amount; | ||
|
||
/** | ||
* Cost type. | ||
* <p> | ||
* The one valid value is "bits". | ||
*/ | ||
@Builder.Default | ||
private String type = "bits"; | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.