Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add gql fetch reward settings (#610)
- Loading branch information
Showing
3 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
138 changes: 138 additions & 0 deletions
138
...rc/main/graphql/com/github/twitch4j/graphql/internal/fetchCommunityPointsSettings.graphql
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,138 @@ | ||
query fetchCommunityPointsSettings($login: String!) { | ||
channel(name: $login) { | ||
id | ||
communityPointsSettings { | ||
name | ||
image { | ||
url | ||
url2x | ||
url4x | ||
} | ||
isEnabled | ||
automaticRewards { | ||
backgroundColor | ||
cost | ||
defaultBackgroundColor | ||
defaultCost | ||
defaultImage { | ||
url | ||
url2x | ||
url4x | ||
} | ||
globallyUpdatedForIndicatorAt | ||
id | ||
image { | ||
url | ||
url2x | ||
url4x | ||
} | ||
isEnabled | ||
isHiddenForSubs | ||
minimumCost | ||
type | ||
updatedForIndicatorAt | ||
} | ||
customRewards { | ||
backgroundColor | ||
cooldownExpiresAt | ||
cost | ||
defaultImage { | ||
url | ||
url2x | ||
url4x | ||
} | ||
globalCooldownSetting { | ||
isEnabled | ||
globalCooldownSeconds | ||
} | ||
id | ||
image { | ||
url | ||
url2x | ||
url4x | ||
} | ||
isEnabled | ||
isInStock | ||
isPaused | ||
isSubOnly | ||
isUserInputRequired | ||
maxPerStreamSetting { | ||
isEnabled | ||
maxPerStream | ||
} | ||
maxPerUserPerStreamSetting { | ||
isEnabled | ||
maxPerUserPerStream | ||
} | ||
prompt | ||
redemptionsRedeemedCurrentStream | ||
shouldRedemptionsSkipRequestQueue | ||
title | ||
updatedForIndicatorAt | ||
} | ||
goals { | ||
amountNeeded | ||
backgroundColor | ||
defaultImage { | ||
url | ||
url2x | ||
url4x | ||
} | ||
description | ||
durationDays | ||
endedAt | ||
id | ||
image { | ||
url | ||
url2x | ||
url4x | ||
} | ||
isInStock | ||
perStreamUserMaximumContribution | ||
pointsContributed | ||
smallContribution | ||
startedAt | ||
status | ||
title | ||
type | ||
} | ||
emoteVariants { | ||
emote { | ||
id | ||
token | ||
} | ||
id | ||
isUnlockable | ||
modifications { | ||
emote { | ||
id | ||
token | ||
} | ||
globallyUpdatedForIndicatorAt | ||
id | ||
modifier { | ||
id | ||
} | ||
} | ||
} | ||
earning { | ||
averagePointsPerHour | ||
cheerPoints | ||
claimPoints | ||
followPoints | ||
id | ||
multipliers { | ||
reasonCode | ||
factor | ||
} | ||
passiveWatchPoints | ||
raidPoints | ||
subscriptionGiftPoints | ||
watchStreakPoints { | ||
points | ||
streakLength | ||
} | ||
} | ||
} | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
...rc/main/java/com/github/twitch4j/graphql/command/CommandFetchCommunityPointsSettings.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,32 @@ | ||
package com.github.twitch4j.graphql.command; | ||
|
||
import com.apollographql.apollo.ApolloCall; | ||
import com.apollographql.apollo.ApolloClient; | ||
import com.github.twitch4j.graphql.internal.FetchCommunityPointsSettingsQuery; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class CommandFetchCommunityPointsSettings extends BaseCommand<FetchCommunityPointsSettingsQuery.Data> { | ||
|
||
private final String channelLogin; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param apolloClient Apollo Client | ||
* @param channelLogin Channel login name | ||
*/ | ||
public CommandFetchCommunityPointsSettings(@NotNull ApolloClient apolloClient, @NotNull String channelLogin) { | ||
super(apolloClient); | ||
this.channelLogin = channelLogin; | ||
} | ||
|
||
@Override | ||
protected ApolloCall<FetchCommunityPointsSettingsQuery.Data> getGraphQLCall() { | ||
return apolloClient.query( | ||
FetchCommunityPointsSettingsQuery.builder() | ||
.login(channelLogin) | ||
.build() | ||
); | ||
} | ||
|
||
} |