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

Module tdlight.api
Package it.tdlight.jni

# Class TdApi.TermsOfService

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

Enclosing class:
  TdApi

public static final class TdApi.TermsOfService extends TdApi.Object
Contains Telegram terms of service.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`CONSTRUCTOR`
`int`
`minUserAge`
The minimum age of a user to be able to accept the terms; 0 if age isn't restricted.
`boolean`
`showPopup`
True, if a blocking popup with terms of service must be shown to the user.
`TdApi.FormattedText`
`text`
Text of the terms of service.

## Constructor Summary

Constructors
Constructor
Description
`TermsOfService()`
Contains Telegram terms of service.
`TermsOfService(TdApi.FormattedText text, int minUserAge, boolean showPopup)`
Contains Telegram terms of service.
`TermsOfService(DataInput input)`
Contains Telegram terms of service.

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

### text

public TdApi.FormattedText text
Text of the terms of service.

### minUserAge

public int minUserAge
The minimum age of a user to be able to accept the terms; 0 if age isn't restricted.

### showPopup

public boolean showPopup
True, if a blocking popup with terms of service must be shown to the user.

### CONSTRUCTOR

public static final int CONSTRUCTOR

See Also:
  - Constant Field Values

## Constructor Details

### TermsOfService

public TermsOfService()
Contains Telegram terms of service.

### TermsOfService

public TermsOfService(TdApi.FormattedText text, int minUserAge, boolean showPopup)
Contains Telegram terms of service.

Parameters:
  `text` - FormattedText Text of the terms of service.
  `minUserAge` - int The minimum age of a user to be able to accept the terms; 0 if age isn't restricted.
  `showPopup` - boolean True, if a blocking popup with terms of service must be shown to the user.

### TermsOfService

public TermsOfService(DataInput input) throws IOException
Contains Telegram terms of service.

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`