# Class: Escalation

## Constructor

#### new Escalation(escalationDetails, escalationService)

  Escalation is used to notify other Participants of
  Conversation that there is an escalation to audio/video.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `escalationDetails` | Object |
  `escalationService` | AvayaClientServices.Services.Messaging.EscalationService |

## Methods

#### addParticipants(participantsToAdd) → {void}

  Adds Participants to Escalation.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `participantsToAdd` | Array.<AvayaClientServices.Services.Messaging.Participant> | Array of Participants

  ##### See:

    - AvayaClientServices.Services.Messaging.Escalation#removeParticipants

  ##### Returns:

  { void }

#### getConversation() → {AvayaClientServices.Services.Messaging.Conversation}

  Returns Conversation to which Escalation belongs.

  ##### Returns:

  { AvayaClientServices.Services.Messaging.Conversation }

#### getParticipants() → {AvayaClientServices.Base.DataSet.<AvayaClientServices.Services.Messaging.Participant>}

  Returns Escalation participants.

  ##### Returns:

  { AvayaClientServices.Base.DataSet.<AvayaClientServices.Services.Messaging.Participant> }

#### getSessionType() → {AvayaClientServices.Services.Messaging.SessionType}

  Returns Escalation session type (e.g. audio, video).

  ##### See:

    - AvayaClientServices.Services.Messaging.Escalation#setSessionType

  ##### Returns:

  { AvayaClientServices.Services.Messaging.SessionType }

#### getStatus() → {AvayaClientServices.Services.Messaging.ResourceStatus}

  Returns current status of Escalation (e.g. draft or published).

  ##### Returns:

  { AvayaClientServices.Services.Messaging.ResourceStatus }

#### removeParticipants(participantsToRemove) → {void}

  Removes Participants from Escalation.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `participantsToRemove` | Array.<AvayaClientServices.Services.Messaging.Participant> | Array of Participants

  ##### See:

    - AvayaClientServices.Services.Messaging.Escalation#addParticipants

  ##### Returns:

  { void }

#### send() → {AvayaClientServices.Base.Promise.<(Object|String)>}

  Starts the Escalation.

  ##### Returns:

  { AvayaClientServices.Base.Promise.<(Object|String)> }

#### setSessionType(sessionType) → {void}

  Sets session type for Escalation.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `sessionType` | AvayaClientServices.Services.Messaging.SessionType |

  ##### See:

    - AvayaClientServices.Services.Messaging.Escalation#getSessionType

  ##### Returns:

  { void }

### Managing callbacks

#### addOnSessionTypeChangedCallback(callback) → {void}

  Adds new onTypeChangedCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.Messaging.Escalation#onTypeChangedCallback |

  ##### Returns:

  { void }

#### addOnStatusChangedCallback(callback) → {void}

  Adds new onResourceStatusChangedCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.Messaging.Escalation#onResourceStatusChangedCallback |

  ##### Returns:

  { void }

#### removeOnSessionTypeChangedCallback(callback) → {void}

  Removes existing onTypeChangedCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.Messaging.Escalation#onTypeChangedCallback |

  ##### Returns:

  { void }

#### removeOnStatusChangedCallback(callback) → {void}

  Removes existing onResourceStatusChangedCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.Messaging.Escalation#onTypeChangedCallback |

  ##### Returns:

  { void }

### Capabilities

#### getAddParticipantsCapability() → {AvayaClientServices.Base.Capability}

  Returns Capability object that indicates if participant can be added to escalation.

  ##### Returns:

  { AvayaClientServices.Base.Capability }

#### getRemoveCapability() → {AvayaClientServices.Base.Capability}

  Returns Capability object that indicates if escalation can be removed.

           if (escalation is DRAFT_UNSENT)
               allow
           else
               deny

  ##### Returns:

  { AvayaClientServices.Base.Capability }

#### getRemoveParticipantsCapability() → {AvayaClientServices.Base.Capability}

  Returns Capability object that indicates if participant can be removed from escalation.

           if (escalation is DRAFT_UNSENT)
               allow
           else
               deny

  ##### Returns:

  { AvayaClientServices.Base.Capability }

#### getSendCapability() → {AvayaClientServices.Base.Capability}

  Returns Capability object that indicates if escalation can be started.

  ##### Returns:

  { AvayaClientServices.Base.Capability }

#### getUpdateSessionTypeCapability() → {AvayaClientServices.Base.Capability}

  Returns Capability object that indicates if session type property can be updated.

           if (escalation is DRAFT_UNSENT)
               allow
           else
               deny

  ##### Returns:

  { AvayaClientServices.Base.Capability }

## Type Definitions

#### onResourceStatusChangedCallback(escalation, resourceStatus) → {void}

  Interface for callback function to be invoked when resource status changes.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `escalation` | AvayaClientServices.Services.Messaging.Escalation | Escalation object.
  `resourceStatus` | AvayaClientServices.Services.Messaging.ResourceStatus | Resources status of Escalation.

  ##### Returns:

  { void }

#### onTypeChangedCallback(escalation, sessionType) → {void}

  Interface for callback function to be invoked when session type changes.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `escalation` | AvayaClientServices.Services.Messaging.Escalation | Escalation object.
  `sessionType` | AvayaClientServices.Services.Messaging.SessionType | Session type of Escalation.

  ##### Returns:

  { void }