# SubscriptionEntity

# SubscriptionEntity

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/SubscriptionEntity "View this page in Kotlin")\|Java  

<br />

```
public final class SubscriptionEntity extends Entity
```

<br />

|---|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)                                                                                            |||
| ↳ | [com.google.android.engage.common.datamodel.Entity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity)                            ||
|   | ↳ | [com.google.android.engage.common.datamodel.SubscriptionEntity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity) |

*** ** * ** ***

An object representing a subscription.

## Summary

|                                                                                                                                                ### Nested types                                                                                                                                                |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `public final class `[SubscriptionEntity.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity.Builder) Builder class for[SubscriptionEntity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity). |

|                                                                                                                     ### Public fields                                                                                                                     |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `final `[ImmutableList](https://guava.dev/releases/21.0/api/docs/com/google/common/collect/ImmutableList.html)`<`[BundledSubscription](https://developer.android.com/reference/com/google/android/engage/common/datamodel/BundledSubscription)`>`         | [bundledSubscriptions](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#bundledSubscriptions())                                                                                                                    |
| `final `[ImmutableList](https://guava.dev/releases/21.0/api/docs/com/google/common/collect/ImmutableList.html)`<`[SubscriptionEntitlement](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntitlement)`>` | [entitlements](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#entitlements())                                                                                                                                    |
| `final `[Long](https://developer.android.com/reference/java/lang/Long.html)                                                                                                                                                                               | [expirationTimeMillis](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#expirationTimeMillis())                                                                                                                    |
| `final `[String](https://developer.android.com/reference/java/lang/String.html)                                                                                                                                                                           | [providerPackageName](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#providerPackageName())                                                                                                                      |
| `final int`                                                                                                                                                                                                                                               | `@`[SubscriptionType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionType) [subscriptionType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#subscriptionType()) |

|                                                                                                                ### Public methods                                                                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ImmutableList](https://guava.dev/releases/21.0/api/docs/com/google/common/collect/ImmutableList.html)`<`[BundledSubscription](https://developer.android.com/reference/com/google/android/engage/common/datamodel/BundledSubscription)`>`         | [getBundledSubscriptions](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#getBundledSubscriptions())`()`                                                                                                                    |
| [ImmutableList](https://guava.dev/releases/21.0/api/docs/com/google/common/collect/ImmutableList.html)`<`[SubscriptionEntitlement](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntitlement)`>` | [getEntitlements](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#getEntitlements())`()`                                                                                                                                    |
| [Long](https://developer.android.com/reference/java/lang/Long.html)                                                                                                                                                                               | [getExpirationTimeMillis](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#getExpirationTimeMillis())`()`                                                                                                                    |
| [String](https://developer.android.com/reference/java/lang/String.html)                                                                                                                                                                           | [getProviderPackageName](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#getProviderPackageName())`()`                                                                                                                      |
| `int`                                                                                                                                                                                                                                             | `@`[SubscriptionType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionType) [getSubscriptionType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#getSubscriptionType())`()` |
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                                                                                                                                                          | [toBundle](https://developer.android.com/reference/com/google/android/engage/common/datamodel/SubscriptionEntity#toBundle())`()`                                                                                                                                                  |

|                                                                                                                                                                                                          ### Inherited methods                                                                                                                                                                                                           |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[com.google.android.engage.common.datamodel.Entity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity) |-------|--------------------------------------------------------------------------------------------------------------------------------| | `int` | [getEntityType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity#getEntityType())`()` | |

## Public fields

### bundledSubscriptions

```
public final ImmutableList<BundledSubscription> bundledSubscriptions
```  

### entitlements

```
public final ImmutableList<SubscriptionEntitlement> entitlements
```  

### expirationTimeMillis

```
public final Long expirationTimeMillis
```  

### providerPackageName

```
public final String providerPackageName
```  

### subscriptionType

```
@SubscriptionType
public final int subscriptionType
```  

## Public methods

### getBundledSubscriptions

```
public ImmutableList<BundledSubscription> getBundledSubscriptions()
```  

### getEntitlements

```
public ImmutableList<SubscriptionEntitlement> getEntitlements()
```  

### getExpirationTimeMillis

```
public Long getExpirationTimeMillis()
```  

### getProviderPackageName

```
public String getProviderPackageName()
```  

### getSubscriptionType

```
@SubscriptionType
public int getSubscriptionType()
```  

### toBundle

```
public Bundle toBundle()
```