# Class: MessageBuilder

## Constructor

#### new MessageBuilder(attachmentBuilder, participantService)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `attachmentBuilder` | AvayaClientServices.Services.Messaging.AttachmentBuilder |
  `participantService` | AvayaClientServices.Services.Messaging.ParticipantService |

## Methods

#### build(messageDetails, fromParticipant, messageService, conversation) → {AvayaClientServices.Services.Messaging.Message}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `messageDetails` | object |
  `fromParticipant` | AvayaClientServices.Services.Messaging.Participant |
  `messageService` | AvayaClientServices.Services.Messaging.MessageService |
  `conversation` | AvayaClientServices.Services.Messaging.Conversation |

  ##### Returns:

  { AvayaClientServices.Services.Messaging.Message }

#### isMessageCoalesced(message, previousMessage) → {boolean}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `message` | AvayaClientServices.Services.Messaging.Message |
  `previousMessage` | AvayaClientServices.Services.Messaging.Message |

  ##### Returns:

  { boolean }

#### pairThumbnailsAndAttachments(arr) → {Array.<AvayaClientServices.Services.Messaging.Attachment>}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `arr` | Array.<AvayaClientServices.Services.Messaging.Attachment> |

  ##### Returns:

  { Array.<AvayaClientServices.Services.Messaging.Attachment> }

#### update(existingMessage, newMessage)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `existingMessage` | AvayaClientServices.Services.Messaging.Message |
  `newMessage` | object |