Class TextMessage
- Namespace
- Geotab.Checkmate.ObjectModel
- Assembly
- Geotab.Checkmate.ObjectModel.dll
[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
DeviceThe device that received the message.
user
UserThe user that sent the message or null.
content
TextMessageContentTypeMessage 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
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
Idid.
version
long?The version.
sent
DateTime?Date message was sent.
delivered
DateTime?Date message was delivered.
device
DeviceThe device that send/received the message.
user
UserThe user that sent the message or null.
messageContent
TextMessageContentTypeMessage content.
isDirectionToVehicle
bool?Message is to or from a vehicle.
markedReadBy
UserUser that read the message.
read
DateTime?Date message was read.
parentMessage
TextMessageThe message that this is a reply to.
activeFrom
DateTime?Date message is active from.
activeTo
DateTime?Date message is active to.
recipient
UserThe user that received the message.
messageSize
int?Message length in bytes
Fields
DefaultMessageSize
Default text message length
public const int DefaultMessageSize = 235
Field Value
MaxMessageSize
Maximum text message length
public const int MaxMessageSize = 65516
Field Value
Properties
ActiveFrom
Gets or sets the date and time the text message is active from.
public DateTime? ActiveFrom { get; set; }
Property Value
ActiveTo
Gets or sets the date and time the text message is active to.
public DateTime? ActiveTo { get; set; }
Property Value
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
Device
Gets or sets the Device the message was sent to. Default [Null].
public Device? Device { get; set; }
Property Value
IsDirectionToVehicle
Gets or sets if message is going to or from vehicle.
[ExcelColumnHeader(new ReportHeading[] { ReportHeading.TextMessageDirectionToVehicle })]
public bool? IsDirectionToVehicle { get; set; }
Property Value
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
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
MessageSize
Gets or sets the message length.
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
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
Recipient
Gets or sets the User the message was sent to. Default [Null].
public User? Recipient { get; set; }
Property Value
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
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
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
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)