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: add aliases for DonationAmount fields #635

Merged
merged 1 commit into from Sep 3, 2022
Merged
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
@@ -1,5 +1,6 @@
package com.github.twitch4j.common.util;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand All @@ -25,18 +26,21 @@ public class DonationAmount {
* <p>
* For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550.
*/
@JsonAlias({ "amount", "donation_amount" })
private Long value;

/**
* The number of decimal places used by the currency.
* <p>
* For example, USD uses two decimal places.
*/
@JsonAlias("exponent")
private Integer decimalPlaces;

/**
* The ISO-4217 three-letter currency code that identifies the type of currency in {@link #getValue()}.
*/
@JsonAlias({ "campaign_currency", "donation_currency" })
private String currency;

/**
Expand Down