-
-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #388 from mircoianese/api_v7.5
BOT API v7.5
- Loading branch information
Showing
35 changed files
with
603 additions
and
10 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
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
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
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
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
70 changes: 70 additions & 0 deletions
70
library/src/main/java/com/pengrad/telegrambot/model/stars/StarTransaction.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,70 @@ | ||
package com.pengrad.telegrambot.model.stars; | ||
|
||
import com.pengrad.telegrambot.model.stars.partner.TransactionPartner; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
public class StarTransaction implements Serializable { | ||
|
||
private final static long serialVersionUID = 0L; | ||
|
||
private String id; | ||
private Integer amount; | ||
private Integer date; | ||
|
||
private TransactionPartner source; | ||
|
||
private TransactionPartner receiver; | ||
|
||
|
||
public String id() { | ||
return id; | ||
} | ||
|
||
public Integer amount() { | ||
return amount; | ||
} | ||
|
||
public Integer date() { | ||
return date; | ||
} | ||
|
||
public TransactionPartner source() { | ||
return source; | ||
} | ||
|
||
public TransactionPartner receiver() { | ||
return receiver; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
StarTransaction that = (StarTransaction) o; | ||
return Objects.equals(id, that.id) && | ||
Objects.equals(amount, that.amount) && | ||
Objects.equals(date, that.date) && | ||
Objects.equals(source, that.source) && | ||
Objects.equals(receiver, that.receiver); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, amount, date, source, receiver); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "StarTransaction{" + | ||
"id='" + id + "'," + | ||
"amount='" + amount + "'," + | ||
"date='" + date + "'," + | ||
"source='" + source + "'," + | ||
"receiver='" + receiver + "'" + | ||
'}'; | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
library/src/main/java/com/pengrad/telegrambot/model/stars/StarTransactions.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,38 @@ | ||
package com.pengrad.telegrambot.model.stars; | ||
|
||
import java.io.Serializable; | ||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
public class StarTransactions implements Serializable { | ||
|
||
private final static long serialVersionUID = 0L; | ||
|
||
private StarTransaction[] transactions; | ||
|
||
public StarTransaction[] transactions() { | ||
return transactions; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
StarTransactions that = (StarTransactions) o; | ||
return Arrays.equals(transactions, that.transactions); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Arrays.hashCode(transactions); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "StarTransactions{" + | ||
"transactions='" + Arrays.toString(transactions) + "'" + | ||
'}'; | ||
} | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
library/src/main/java/com/pengrad/telegrambot/model/stars/partner/TransactionPartner.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,41 @@ | ||
package com.pengrad.telegrambot.model.stars.partner; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
public abstract class TransactionPartner implements Serializable { | ||
|
||
private final static long serialVersionUID = 0L; | ||
|
||
private String type; | ||
|
||
public TransactionPartner(String type) { | ||
this.type = type; | ||
} | ||
|
||
public String type() { | ||
return type; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
TransactionPartner that = (TransactionPartner) o; | ||
return Objects.equals(type, that.type); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(type); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TransactionPartner{" + | ||
"type='" + type + "'" + | ||
'}'; | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
...src/main/java/com/pengrad/telegrambot/model/stars/partner/TransactionPartnerFragment.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,43 @@ | ||
package com.pengrad.telegrambot.model.stars.partner; | ||
|
||
import com.pengrad.telegrambot.model.stars.withdrawal.RevenueWithdrawalState; | ||
|
||
import java.util.Objects; | ||
|
||
public class TransactionPartnerFragment extends TransactionPartner { | ||
|
||
public final static String TYPE = "fragment"; | ||
|
||
private RevenueWithdrawalState withdrawal_state; | ||
|
||
public TransactionPartnerFragment() { | ||
super(TYPE); | ||
} | ||
|
||
public RevenueWithdrawalState withdrawalState() { | ||
return withdrawal_state; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
TransactionPartnerFragment that = (TransactionPartnerFragment) o; | ||
return Objects.equals(type(), that.type()) && | ||
Objects.equals(withdrawal_state, that.withdrawal_state); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(type(), withdrawal_state); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TransactionPartnerFragment{" + | ||
"type='" + type() + "\'," + | ||
", withdrawal_state=" + withdrawal_state + "\'" + | ||
'}'; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...ry/src/main/java/com/pengrad/telegrambot/model/stars/partner/TransactionPartnerOther.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,34 @@ | ||
package com.pengrad.telegrambot.model.stars.partner; | ||
|
||
import java.util.Objects; | ||
|
||
public class TransactionPartnerOther extends TransactionPartner { | ||
|
||
public final static String TYPE = "other"; | ||
|
||
public TransactionPartnerOther() { | ||
super(TYPE); | ||
} | ||
|
||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
TransactionPartnerOther that = (TransactionPartnerOther) o; | ||
return Objects.equals(type(), that.type()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(type()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TransactionPartnerOther{" + | ||
"type='" + type() + "\'" + | ||
'}'; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
.../main/java/com/pengrad/telegrambot/model/stars/partner/TransactionPartnerTelegramAds.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,34 @@ | ||
package com.pengrad.telegrambot.model.stars.partner; | ||
|
||
import java.util.Objects; | ||
|
||
public class TransactionPartnerTelegramAds extends TransactionPartner { | ||
|
||
public final static String TYPE = "telegram_ads"; | ||
|
||
public TransactionPartnerTelegramAds() { | ||
super(TYPE); | ||
} | ||
|
||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
TransactionPartnerTelegramAds that = (TransactionPartnerTelegramAds) o; | ||
return Objects.equals(type(), that.type()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(type()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TransactionPartnerTelegramAds{" + | ||
"type='" + type() + "\'" + | ||
'}'; | ||
} | ||
|
||
} |
Oops, something went wrong.