Table of Contents

Class TextMessage

Namespace
Geotab.Checkmate.ObjectModel
Assembly
Geotab.Checkmate.ObjectModel.dll

A message to send or received from a device.

When working with text messages it is important to make the distinction between a "Reply" and a "Response".
[ReportClass]
public class TextMessage : EntityWithVersion, IEntity, IComparable, IIdentifiable, IVersion, IDeviceProvider, IDefaultable, IInstanceSizeEstimate
Inheritance
TextMessage
Implements
Inherited Members

Constructors

TextMessage()

Initializes a new instance of the TextMessage class.constructor.

public TextMessage()

TextMessage(Device?, User?, TextMessageContentType?, bool?)

Initializes a new instance of the TextMessage class.Constructor.

public TextMessage(Device? device, User? user, TextMessageContentType? content, bool? directionToVehicle)

Parameters

device Device

The device that received the message.

user User

The user that sent the message or null.

content TextMessageContentType

Message content.

directionToVehicle bool?

Message is to or from a vehicle.

TextMessage(Id)

Initializes a new instance of the TextMessage class.Constructor.

public TextMessage(Id id)

Parameters

id Id

The. Id

TextMessage(Id?, long?, DateTime?, DateTime?, Device?, User?, TextMessageContentType?, bool?, User?, DateTime?, TextMessage?, DateTime?, DateTime?, User?, int?)

Initializes a new instance of the TextMessage class.Constructor.

public TextMessage(Id? id, long? version, DateTime? sent, DateTime? delivered, Device? device, User? user, TextMessageContentType? messageContent, bool? isDirectionToVehicle, User? markedReadBy, DateTime? read, TextMessage? parentMessage, DateTime? activeFrom, DateTime? activeTo, User? recipient = null, int? messageSize = null)

Parameters

id Id

id.

version long?

The version.

sent DateTime?

Date message was sent.

delivered DateTime?

Date message was delivered.

device Device

The device that send/received the message.

user User

The user that sent the message or null.

messageContent TextMessageContentType

Message content.

isDirectionToVehicle bool?

Message is to or from a vehicle.

markedReadBy User

User that read the message.

read DateTime?

Date message was read.

parentMessage TextMessage

The message that this is a reply to.

activeFrom DateTime?

Date message is active from.

activeTo DateTime?

Date message is active to.

recipient User

The user that received the message.

messageSize int?

Message length in bytes

Fields

DefaultMessageSize

Default text message length

public const int DefaultMessageSize = 235

Field Value

int

MaxMessageSize

Maximum text message length

public const int MaxMessageSize = 65516

Field Value

int

Properties

ActiveFrom

Gets or sets the date and time the text message is active from.

public DateTime? ActiveFrom { get; set; }

Property Value

DateTime?

DateTime

ActiveTo

Gets or sets the date and time the text message is active to.

public DateTime? ActiveTo { get; set; }

Property Value

DateTime?

DateTime

Delivered

Gets or sets the date and time the message was delivered. Default [MaxDate].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.TextMessageDeliveredDate })]
public DateTime? Delivered { get; set; }

Property Value

DateTime?

DateTime

Device

Gets or sets the Device the message was sent to. Default [Null].

public Device? Device { get; set; }

Property Value

Device

Device

IsDirectionToVehicle

Gets or sets if message is going to or from vehicle.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.TextMessageDirectionToVehicle })]
public bool? IsDirectionToVehicle { get; set; }

Property Value

bool?

bool

MarkedReadBy

Gets or sets the User who read the message or null if the message has not been read.

public User? MarkedReadBy { get; set; }

Property Value

User

User

MessageContent

Gets or sets the message content. A basic message can be sent via a TextContent or a message with predefined ("canned") responses by a CannedResponseContent or a series of LocationContent comprising a route.

public TextMessageContentType? MessageContent { get; set; }

Property Value

TextMessageContentType

TextContent

MessageSize

Gets or sets the message length. false

public int? MessageSize { get; set; }

Property Value

int?

The message size

ParentMessage

Gets or sets the text message that this is the reply to. Only a reply message will have a parent.

public TextMessage? ParentMessage { get; set; }

Property Value

TextMessage

TextMessage

Read

Gets or sets the date and time the message was read or null if the message has not been read.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.TextMessageReadDate })]
public DateTime? Read { get; set; }

Property Value

DateTime?

DateTime

Recipient

Gets or sets the User the message was sent to. Default [Null].

public User? Recipient { get; set; }

Property Value

User

User

ReplyMessage

Gets or sets the text message reply to this message. A text message should only have one reply. (Should not reply to a reply). Default [Null]

public TextMessage? ReplyMessage { get; set; }

Property Value

TextMessage

TextMessage

Sent

Gets or sets the date and time the message was sent. Default [MaxDate].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.TextMessageSentDate })]
public DateTime? Sent { get; set; }

Property Value

DateTime?

DateTime

User

Gets or sets the User that the message was sent from or null. If the message was sent from a device or was generated by the system the user property will be null. Default [Null].

public User? User { get; set; }

Property Value

User

User

Methods

Clone()

Creates a new object that is a copy of the current instance.

public override IEntity Clone()

Returns

IEntity

A new object that is a copy of this instance.

GetBase64Payload()

The length of the message payload converted to base64.

public long GetBase64Payload()

Returns

long

Returns the size of the payload base64 encoded.

GetHeader()

The length of all message fields except the payload.

public long GetHeader()

Returns

long

Returns the header size.

GetPayload()

The length of the message payload.

public long GetPayload()

Returns

long

Returns the payload size.

GetSerializedSize()

Gets the serialized size estimate of this instance in bytes.

public long GetSerializedSize()

Returns

long

Returns the size of the entity.

GetSize()

Gets the size estimate of this instance in bytes.

public long GetSize()

Returns

long

Returns the size of the entity.

PopulateDefaults()

Populate non-required empty (null) properties with default values.

public void PopulateDefaults()

RemoveSystemMessages(IList<object>)

Remove system messages from a collection of text messages.

public static void RemoveSystemMessages(IList<object> textMessages)

Parameters

textMessages IList<object>

The collection of text message.