-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add monetization data classes (#160)
- Loading branch information
Showing
7 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/discord4j/discordjson/json/CreateTestEntitlementRequest.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,27 @@ | ||
package discord4j.discordjson.json; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import discord4j.discordjson.Id; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableCreateTestEntitlementRequest.class) | ||
@JsonDeserialize(as = ImmutableCreateTestEntitlementRequest.class) | ||
public interface CreateTestEntitlementRequest { | ||
|
||
static ImmutableCreateTestEntitlementRequest.Builder builder() { | ||
return ImmutableCreateTestEntitlementRequest.builder(); | ||
} | ||
|
||
@JsonProperty("sku_id") | ||
Id skuId(); | ||
|
||
@JsonProperty("owner_id") | ||
Id ownerId(); | ||
|
||
@JsonProperty("owner_type") | ||
int ownerType(); | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/discord4j/discordjson/json/EntitlementData.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,48 @@ | ||
package discord4j.discordjson.json; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import discord4j.discordjson.Id; | ||
import discord4j.discordjson.possible.Possible; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableEntitlementData.class) | ||
@JsonDeserialize(as = ImmutableEntitlementData.class) | ||
public interface EntitlementData { | ||
|
||
static ImmutableEntitlementData.Builder builder() { | ||
return ImmutableEntitlementData.builder(); | ||
} | ||
|
||
Id id(); | ||
|
||
@JsonProperty("sku_id") | ||
Id skuId(); | ||
|
||
@JsonProperty("application_id") | ||
Id applicationId(); | ||
|
||
@JsonProperty("user_id") | ||
Possible<Id> userId(); | ||
|
||
int type(); | ||
|
||
boolean deleted(); | ||
|
||
@JsonProperty("guild_id") | ||
Possible<Id> guildId(); | ||
|
||
// The following fields will not be present in test entitlements | ||
|
||
@JsonProperty("starts_at") | ||
Possible<String> startsAt(); | ||
|
||
@JsonProperty("ends_at") | ||
Possible<String> endsAt(); | ||
|
||
@JsonProperty("subscription_id") | ||
Possible<Id> subscriptionId(); | ||
|
||
} |
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
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,30 @@ | ||
package discord4j.discordjson.json; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import discord4j.discordjson.Id; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableSkuData.class) | ||
@JsonDeserialize(as = ImmutableSkuData.class) | ||
public interface SkuData { | ||
|
||
static ImmutableSkuData.Builder builder() { | ||
return ImmutableSkuData.builder(); | ||
} | ||
|
||
Id id(); | ||
|
||
int type(); | ||
|
||
@JsonProperty("application_id") | ||
Id applicationId(); | ||
|
||
String name(); | ||
|
||
String slug(); | ||
|
||
int flags(); | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/discord4j/discordjson/json/gateway/EntitlementCreate.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,21 @@ | ||
package discord4j.discordjson.json.gateway; | ||
|
||
import com.fasterxml.jackson.annotation.JsonUnwrapped; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import discord4j.discordjson.json.EntitlementData; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableEntitlementCreate.class) | ||
@JsonDeserialize(as = ImmutableEntitlementCreate.class) | ||
public interface EntitlementCreate extends Dispatch { | ||
|
||
static ImmutableEntitlementCreate.Builder builder() { | ||
return ImmutableEntitlementCreate.builder(); | ||
} | ||
|
||
@JsonUnwrapped | ||
EntitlementData entitlement(); | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/discord4j/discordjson/json/gateway/EntitlementDelete.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,21 @@ | ||
package discord4j.discordjson.json.gateway; | ||
|
||
import com.fasterxml.jackson.annotation.JsonUnwrapped; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import discord4j.discordjson.json.EntitlementData; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableEntitlementDelete.class) | ||
@JsonDeserialize(as = ImmutableEntitlementDelete.class) | ||
public interface EntitlementDelete extends Dispatch { | ||
|
||
static ImmutableEntitlementDelete.Builder builder() { | ||
return ImmutableEntitlementDelete.builder(); | ||
} | ||
|
||
@JsonUnwrapped | ||
EntitlementData entitlement(); | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/discord4j/discordjson/json/gateway/EntitlementUpdate.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,21 @@ | ||
package discord4j.discordjson.json.gateway; | ||
|
||
import com.fasterxml.jackson.annotation.JsonUnwrapped; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import discord4j.discordjson.json.EntitlementData; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableEntitlementUpdate.class) | ||
@JsonDeserialize(as = ImmutableEntitlementUpdate.class) | ||
public interface EntitlementUpdate extends Dispatch { | ||
|
||
static ImmutableEntitlementUpdate.Builder builder() { | ||
return ImmutableEntitlementUpdate.builder(); | ||
} | ||
|
||
@JsonUnwrapped | ||
EntitlementData entitlement(); | ||
|
||
} |