Module tdlight.api
Package it.tdlight.jni

# Class TdApi.MessageGiftedPremium

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.MessageContent
it.tdlight.jni.TdApi.MessageGiftedPremium

Enclosing class:
  TdApi

public static final class TdApi.MessageGiftedPremium extends TdApi.MessageContent
Telegram Premium was gifted to the user.

## Field Summary

Fields
Modifier and Type
Field
Description
`long`
`amount`
The paid amount, in the smallest units of the currency.
`static final int`
`CONSTRUCTOR`
Identifier uniquely determining type of the object.
`String`
`cryptocurrency`
Cryptocurrency used to pay for the gift; may be empty if none.
`long`
`cryptocurrencyAmount`
The paid amount, in the smallest units of the cryptocurrency; 0 if none.
`String`
`currency`
Currency for the paid amount.
`long`
`gifterUserId`
The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous.
`int`
`monthCount`
Number of months the Telegram Premium subscription will be active.
`TdApi.Sticker`
`sticker`
A sticker to be shown in the message; may be null if unknown.

## Constructor Summary

Constructors
Constructor
Description
`MessageGiftedPremium()`
Telegram Premium was gifted to the user.
`MessageGiftedPremium(long gifterUserId, String currency, long amount, String cryptocurrency, long cryptocurrencyAmount, int monthCount, TdApi.Sticker sticker)`
Telegram Premium was gifted to the user.
`MessageGiftedPremium(DataInput input)`
Telegram Premium was gifted to the user.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`int`
`getConstructor()`
Returns an identifier uniquely determining type of the object.
`int`
`hashCode()`
`void`
`serialize(DataOutput output)`
Serialize the TDLib class

### Methods inherited from class it.tdlight.jni.TdApi.Object

`serialize, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### gifterUserId

public long gifterUserId
The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous.

### currency

public String currency
Currency for the paid amount.

### amount

public long amount
The paid amount, in the smallest units of the currency.

### cryptocurrency

public String cryptocurrency
Cryptocurrency used to pay for the gift; may be empty if none.

### cryptocurrencyAmount

public long cryptocurrencyAmount
The paid amount, in the smallest units of the cryptocurrency; 0 if none.

### monthCount

public int monthCount
Number of months the Telegram Premium subscription will be active.

### sticker

public TdApi.Sticker sticker
A sticker to be shown in the message; may be null if unknown.

### CONSTRUCTOR

public static final int CONSTRUCTOR
Identifier uniquely determining type of the object.

See Also:
  - Constant Field Values

## Constructor Details

### MessageGiftedPremium

public MessageGiftedPremium()
Telegram Premium was gifted to the user.

### MessageGiftedPremium

public MessageGiftedPremium(long gifterUserId, String currency, long amount, String cryptocurrency, long cryptocurrencyAmount, int monthCount, TdApi.Sticker sticker)
Telegram Premium was gifted to the user.

Parameters:
  `gifterUserId` - The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous.
  `currency` - Currency for the paid amount.
  `amount` - The paid amount, in the smallest units of the currency.
  `cryptocurrency` - Cryptocurrency used to pay for the gift; may be empty if none.
  `cryptocurrencyAmount` - The paid amount, in the smallest units of the cryptocurrency; 0 if none.
  `monthCount` - Number of months the Telegram Premium subscription will be active.
  `sticker` - A sticker to be shown in the message; may be null if unknown.

### MessageGiftedPremium

public MessageGiftedPremium(DataInput input) throws IOException
Telegram Premium was gifted to the user.

Parameters:
  `input` - Serialized input
Throws:
  `IOException` - the deserialization failed

## Method Details

### getConstructor

public int getConstructor()
Description copied from class: `TdApi.Object`
Returns an identifier uniquely determining type of the object.

Specified by:
  `getConstructor` in class `TdApi.Object`
Returns:
  this.CONSTRUCTOR

### serialize

public void serialize(DataOutput output) throws IOException
Serialize the TDLib class

Specified by:
  `serialize` in class `TdApi.Object`
Parameters:
  `output` - output data stream
Throws:
  `IOException` - the serialization failed

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`