Module tdlight.api
Package it.tdlight.jni

# Class TdApi.Session

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

Enclosing class:
  TdApi

public static final class TdApi.Session extends TdApi.Object
Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order.

## Field Summary

Fields
Modifier and Type
Field
Description
`int`
`apiId`
Telegram API identifier, as provided by the application.
`String`
`applicationName`
Name of the application, as provided by the application.
`String`
`applicationVersion`
The version of the application, as provided by the application.
`boolean`
`canAcceptCalls`
True, if incoming calls can be accepted by the session.
`boolean`
`canAcceptSecretChats`
True, if incoming secret chats can be accepted by the session.
`static final int`
`CONSTRUCTOR`
Identifier uniquely determining type of the object.
`String`
`deviceModel`
Model of the device the application has been run or is running on, as provided by the application.
`long`
`id`
Session identifier.
`String`
`ipAddress`
IP address from which the session was created, in human-readable format.
`boolean`
`isCurrent`
True, if this session is the current session.
`boolean`
`isOfficialApplication`
True, if the application is an official application or uses the apiId of an official application.
`boolean`
`isPasswordPending`
True, if a 2-step verification password is needed to complete authorization of the session.
`boolean`
`isUnconfirmed`
True, if the session wasn't confirmed from another session.
`int`
`lastActiveDate`
Point in time (Unix timestamp) when the session was last used.
`String`
`location`
A human-readable description of the location from which the session was created, based on the IP address.
`int`
`logInDate`
Point in time (Unix timestamp) when the user has logged in.
`String`
`platform`
Operating system the application has been run or is running on, as provided by the application.
`String`
`systemVersion`
Version of the operating system the application has been run or is running on, as provided by the application.
`TdApi.SessionType`
`type`
Session type based on the system and application version, which can be used to display a corresponding icon.

## Constructor Summary

Constructors
Constructor
Description
`Session()`
Contains information about one session in a Telegram application used by the current user.
`Session(long id, boolean isCurrent, boolean isPasswordPending, boolean isUnconfirmed, boolean canAcceptSecretChats, boolean canAcceptCalls, TdApi.SessionType type, int apiId, String applicationName, String applicationVersion, boolean isOfficialApplication, String deviceModel, String platform, String systemVersion, int logInDate, int lastActiveDate, String ipAddress, String location)`
Contains information about one session in a Telegram application used by the current user.
`Session(DataInput input)`
Contains information about one session in a Telegram application used by the current 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

### id

public long id
Session identifier.

### isCurrent

public boolean isCurrent
True, if this session is the current session.

### isPasswordPending

public boolean isPasswordPending
True, if a 2-step verification password is needed to complete authorization of the session.

### isUnconfirmed

public boolean isUnconfirmed
True, if the session wasn't confirmed from another session.

### canAcceptSecretChats

public boolean canAcceptSecretChats
True, if incoming secret chats can be accepted by the session.

### canAcceptCalls

public boolean canAcceptCalls
True, if incoming calls can be accepted by the session.

### type

public TdApi.SessionType type
Session type based on the system and application version, which can be used to display a corresponding icon.

### apiId

public int apiId
Telegram API identifier, as provided by the application.

### applicationName

public String applicationName
Name of the application, as provided by the application.

### applicationVersion

public String applicationVersion
The version of the application, as provided by the application.

### isOfficialApplication

public boolean isOfficialApplication
True, if the application is an official application or uses the apiId of an official application.

### deviceModel

public String deviceModel
Model of the device the application has been run or is running on, as provided by the application.

### platform

public String platform
Operating system the application has been run or is running on, as provided by the application.

### systemVersion

public String systemVersion
Version of the operating system the application has been run or is running on, as provided by the application.

### logInDate

public int logInDate
Point in time (Unix timestamp) when the user has logged in.

### lastActiveDate

public int lastActiveDate
Point in time (Unix timestamp) when the session was last used.

### ipAddress

public String ipAddress
IP address from which the session was created, in human-readable format.

### location

public String location
A human-readable description of the location from which the session was created, based on the IP address.

### CONSTRUCTOR

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

See Also:
  - Constant Field Values

## Constructor Details

### Session

public Session()
Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order.

### Session

public Session(long id, boolean isCurrent, boolean isPasswordPending, boolean isUnconfirmed, boolean canAcceptSecretChats, boolean canAcceptCalls, TdApi.SessionType type, int apiId, String applicationName, String applicationVersion, boolean isOfficialApplication, String deviceModel, String platform, String systemVersion, int logInDate, int lastActiveDate, String ipAddress, String location)
Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order.

Parameters:
  `id` - Session identifier.
  `isCurrent` - True, if this session is the current session.
  `isPasswordPending` - True, if a 2-step verification password is needed to complete authorization of the session.
  `isUnconfirmed` - True, if the session wasn't confirmed from another session.
  `canAcceptSecretChats` - True, if incoming secret chats can be accepted by the session.
  `canAcceptCalls` - True, if incoming calls can be accepted by the session.
  `type` - Session type based on the system and application version, which can be used to display a corresponding icon.
  `apiId` - Telegram API identifier, as provided by the application.
  `applicationName` - Name of the application, as provided by the application.
  `applicationVersion` - The version of the application, as provided by the application.
  `isOfficialApplication` - True, if the application is an official application or uses the apiId of an official application.
  `deviceModel` - Model of the device the application has been run or is running on, as provided by the application.
  `platform` - Operating system the application has been run or is running on, as provided by the application.
  `systemVersion` - Version of the operating system the application has been run or is running on, as provided by the application.
  `logInDate` - Point in time (Unix timestamp) when the user has logged in.
  `lastActiveDate` - Point in time (Unix timestamp) when the session was last used.
  `ipAddress` - IP address from which the session was created, in human-readable format.
  `location` - A human-readable description of the location from which the session was created, based on the IP address.

### Session

public Session(DataInput input) throws IOException
Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order.

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`