Module tdlight.api
Package it.tdlight.jni

# Class TdApi.SponsoredMessage

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

Enclosing class:
  TdApi

public static final class TdApi.SponsoredMessage extends TdApi.Object
Describes a sponsored message.

## Field Summary

Fields
Modifier and Type
Field
Description
`String`
`additionalInfo`
If non-empty, additional information about the sponsored message to be shown along with the message.
`String`
`buttonText`
If non-empty, text for the message action button.
`static final int`
`CONSTRUCTOR`
Identifier uniquely determining type of the object.
`TdApi.MessageContent`
`content`
Content of the message.
`boolean`
`isRecommended`
True, if the message needs to be labeled as "recommended" instead of "sponsored".
`long`
`messageId`
Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages.
`TdApi.MessageSponsor`
`sponsor`
Information about the sponsor of the message.

## Constructor Summary

Constructors
Constructor
Description
`SponsoredMessage()`
Describes a sponsored message.
`SponsoredMessage(long messageId, boolean isRecommended, TdApi.MessageContent content, TdApi.MessageSponsor sponsor, String buttonText, String additionalInfo)`
Describes a sponsored message.
`SponsoredMessage(DataInput input)`
Describes a sponsored message.

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

### messageId

public long messageId
Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages.

### isRecommended

public boolean isRecommended
True, if the message needs to be labeled as "recommended" instead of "sponsored".

### content

public TdApi.MessageContent content
Content of the message. Currently, can be only of the type messageText.

### sponsor

public TdApi.MessageSponsor sponsor
Information about the sponsor of the message.

### buttonText

public String buttonText
If non-empty, text for the message action button.

### additionalInfo

public String additionalInfo
If non-empty, additional information about the sponsored message to be shown along with the message.

### CONSTRUCTOR

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

See Also:
  - Constant Field Values

## Constructor Details

### SponsoredMessage

public SponsoredMessage()
Describes a sponsored message.

### SponsoredMessage

public SponsoredMessage(long messageId, boolean isRecommended, TdApi.MessageContent content, TdApi.MessageSponsor sponsor, String buttonText, String additionalInfo)
Describes a sponsored message.

Parameters:
  `messageId` - Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages.
  `isRecommended` - True, if the message needs to be labeled as "recommended" instead of "sponsored".
  `content` - Content of the message. Currently, can be only of the type messageText.
  `sponsor` - Information about the sponsor of the message.
  `buttonText` - If non-empty, text for the message action button.
  `additionalInfo` - If non-empty, additional information about the sponsored message to be shown along with the message.

### SponsoredMessage

public SponsoredMessage(DataInput input) throws IOException
Describes a sponsored message.

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`