# TdApi.StorePaymentPurposePremiumSubscription (tdlight API 4.0.311 API)
declaration: module: tdlight.api, package: it.tdlight.jni, class: TdApi, class: StorePaymentPurposePremiumSubscription

Module tdlight.api
Package it.tdlight.jni

# Class TdApi.StorePaymentPurposePremiumSubscription

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.StorePaymentPurpose
it.tdlight.jni.TdApi.StorePaymentPurposePremiumSubscription

Enclosing class:
  TdApi

public static final class TdApi.StorePaymentPurposePremiumSubscription extends TdApi.StorePaymentPurpose
The user subscribed to Telegram Premium.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`CONSTRUCTOR`
`boolean`
`isRestore`
Pass true if this is a restore of a Telegram Premium purchase; only for App Store.
`boolean`
`isUpgrade`
Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store.

## Constructor Summary

Constructors
Constructor
Description
`StorePaymentPurposePremiumSubscription()`
The user subscribed to Telegram Premium.
`StorePaymentPurposePremiumSubscription(boolean isRestore, boolean isUpgrade)`
The user subscribed to Telegram Premium.
`StorePaymentPurposePremiumSubscription(DataInput input)`
The user subscribed to Telegram Premium.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`int`
`getConstructor()`
`int`
`hashCode()`
`void`
`serialize(DataOutput output)`

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

### isRestore

public boolean isRestore
Pass true if this is a restore of a Telegram Premium purchase; only for App Store.

### isUpgrade

public boolean isUpgrade
Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store.

### CONSTRUCTOR

public static final int CONSTRUCTOR

See Also:
  - Constant Field Values

## Constructor Details

### StorePaymentPurposePremiumSubscription

public StorePaymentPurposePremiumSubscription()
The user subscribed to Telegram Premium.

### StorePaymentPurposePremiumSubscription

public StorePaymentPurposePremiumSubscription(boolean isRestore, boolean isUpgrade)
The user subscribed to Telegram Premium.

Parameters:
  `isRestore` - boolean Pass true if this is a restore of a Telegram Premium purchase; only for App Store.
  `isUpgrade` - boolean Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store.

### StorePaymentPurposePremiumSubscription

public StorePaymentPurposePremiumSubscription(DataInput input) throws IOException
The user subscribed to Telegram Premium.

Throws:
  `IOException`

## Method Details

### getConstructor

public int getConstructor()

Specified by:
  `getConstructor` in class `TdApi.Object`

### serialize

public void serialize(DataOutput output) throws IOException

Specified by:
  `serialize` in class `TdApi.Object`
Throws:
  `IOException`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`