Module tdlight.api
Package it.tdlight.jni

# Class TdApi.PremiumGiftCodeInfo

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.PremiumGiftCodeInfo

Enclosing class:
  TdApi

public static final class TdApi.PremiumGiftCodeInfo extends TdApi.Object
Contains information about a Telegram Premium gift code.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`CONSTRUCTOR`
Identifier uniquely determining type of the object.
`int`
`creationDate`
Point in time (Unix timestamp) when the code was created.
`TdApi.MessageSender`
`creatorId`
Identifier of a chat or a user that created the gift code; may be null if unknown.
`long`
`giveawayMessageId`
Identifier of the corresponding giveaway message in the creatorId chat; can be 0 or an identifier of a deleted message.
`boolean`
`isFromGiveaway`
True, if the gift code was created for a giveaway.
`int`
`monthCount`
Number of months the Telegram Premium subscription will be active after code activation.
`int`
`useDate`
Point in time (Unix timestamp) when the code was activated; 0 if none.
`long`
`userId`
Identifier of a user for which the code was created; 0 if none.

## Constructor Summary

Constructors
Constructor
Description
`PremiumGiftCodeInfo()`
Contains information about a Telegram Premium gift code.
`PremiumGiftCodeInfo(TdApi.MessageSender creatorId, int creationDate, boolean isFromGiveaway, long giveawayMessageId, int monthCount, long userId, int useDate)`
Contains information about a Telegram Premium gift code.
`PremiumGiftCodeInfo(DataInput input)`
Contains information about a Telegram Premium gift code.

## 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

### creatorId

public TdApi.MessageSender creatorId
Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creatorId from the message can be used.

### creationDate

public int creationDate
Point in time (Unix timestamp) when the code was created.

### isFromGiveaway

public boolean isFromGiveaway
True, if the gift code was created for a giveaway.

### giveawayMessageId

public long giveawayMessageId
Identifier of the corresponding giveaway message in the creatorId chat; can be 0 or an identifier of a deleted message.

### monthCount

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

### userId

public long userId
Identifier of a user for which the code was created; 0 if none.

### useDate

public int useDate
Point in time (Unix timestamp) when the code was activated; 0 if none.

### CONSTRUCTOR

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

See Also:
  - Constant Field Values

## Constructor Details

### PremiumGiftCodeInfo

public PremiumGiftCodeInfo()
Contains information about a Telegram Premium gift code.

### PremiumGiftCodeInfo

public PremiumGiftCodeInfo(TdApi.MessageSender creatorId, int creationDate, boolean isFromGiveaway, long giveawayMessageId, int monthCount, long userId, int useDate)
Contains information about a Telegram Premium gift code.

Parameters:
  `creatorId` - Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creatorId from the message can be used.
  `creationDate` - Point in time (Unix timestamp) when the code was created.
  `isFromGiveaway` - True, if the gift code was created for a giveaway.
  `giveawayMessageId` - Identifier of the corresponding giveaway message in the creatorId chat; can be 0 or an identifier of a deleted message.
  `monthCount` - Number of months the Telegram Premium subscription will be active after code activation.
  `userId` - Identifier of a user for which the code was created; 0 if none.
  `useDate` - Point in time (Unix timestamp) when the code was activated; 0 if none.

### PremiumGiftCodeInfo

public PremiumGiftCodeInfo(DataInput input) throws IOException
Contains information about a Telegram Premium gift code.

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`