-
-
Notifications
You must be signed in to change notification settings - Fork 375
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 #389 from mircoianese/api_v7.6
BOT API v7.6
- Loading branch information
Showing
18 changed files
with
536 additions
and
9 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
41 changes: 41 additions & 0 deletions
41
library/src/main/java/com/pengrad/telegrambot/model/paidmedia/PaidMedia.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.paidmedia; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
public abstract class PaidMedia implements Serializable { | ||
|
||
private final static long serialVersionUID = 0L; | ||
|
||
private String type; | ||
|
||
public PaidMedia(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; | ||
|
||
PaidMedia that = (PaidMedia) o; | ||
return Objects.equals(type, that.type); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(type); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PaidMedia{" + | ||
"type='" + type + "'" + | ||
'}'; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
library/src/main/java/com/pengrad/telegrambot/model/paidmedia/PaidMediaInfo.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,46 @@ | ||
package com.pengrad.telegrambot.model.paidmedia; | ||
|
||
import java.io.Serializable; | ||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
public class PaidMediaInfo implements Serializable { | ||
|
||
private final static long serialVersionUID = 0L; | ||
|
||
private Integer star_count; | ||
|
||
private PaidMedia[] paid_media; | ||
|
||
public Integer starCount() { | ||
return star_count; | ||
} | ||
|
||
public PaidMedia[] paidMedia() { | ||
return paid_media; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
PaidMediaInfo that = (PaidMediaInfo) o; | ||
return Objects.equals(star_count, that.star_count) && | ||
Arrays.equals(paid_media, that.paid_media); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(star_count, paid_media); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PaidMediaInfo{" + | ||
"star_count='" + star_count + "'," + | ||
"paid_media='" + Arrays.toString(paid_media) + "'" + | ||
'}'; | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
library/src/main/java/com/pengrad/telegrambot/model/paidmedia/PaidMediaPhoto.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,44 @@ | ||
package com.pengrad.telegrambot.model.paidmedia; | ||
|
||
import com.pengrad.telegrambot.model.PhotoSize; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
public class PaidMediaPhoto extends PaidMedia { | ||
|
||
public final static String TYPE = "photo"; | ||
|
||
private PhotoSize[] photo; | ||
|
||
public PaidMediaPhoto() { | ||
super(TYPE); | ||
} | ||
|
||
public PhotoSize[] getPhoto() { | ||
return photo; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
PaidMediaPhoto that = (PaidMediaPhoto) o; | ||
return Objects.equals(type(), that.type()) && | ||
Arrays.equals(photo, that.photo); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(type(), photo); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PaidMediaPhoto{" + | ||
"type='" + type() + "\'," + | ||
", photo=" + Arrays.toString(photo) + "\'" + | ||
'}'; | ||
} | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
library/src/main/java/com/pengrad/telegrambot/model/paidmedia/PaidMediaPreview.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,57 @@ | ||
package com.pengrad.telegrambot.model.paidmedia; | ||
|
||
import java.util.Objects; | ||
|
||
public class PaidMediaPreview extends PaidMedia { | ||
|
||
public final static String TYPE = "preview"; | ||
|
||
private Integer width; | ||
|
||
private Integer height; | ||
|
||
private Integer duration; | ||
|
||
public PaidMediaPreview() { | ||
super(TYPE); | ||
} | ||
|
||
public Integer getWidth() { | ||
return width; | ||
} | ||
|
||
public Integer getHeight() { | ||
return height; | ||
} | ||
|
||
public Integer getDuration() { | ||
return duration; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
PaidMediaPreview that = (PaidMediaPreview) o; | ||
return Objects.equals(type(), that.type()) && | ||
Objects.equals(width, that.width) && | ||
Objects.equals(height, that.height) && | ||
Objects.equals(duration, that.duration); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(type(), width, height, duration); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PaidMediaPreview{" + | ||
"type='" + type() + "\'," + | ||
", width=" + width + "\'," + | ||
", height=" + height + "\'," + | ||
", duration=" + duration + "\'" + | ||
'}'; | ||
} | ||
|
||
} |
Oops, something went wrong.