---
url: https://docs.moqtail.dev/ts/api/model/classes/SwitchFrom.md
---
# Class: SwitchFrom

Identifies the subscription being replaced by a switch request.
The value is two varints followed by a flags byte: bit 7 (MSB) is Publish Done;
bits 0 through 6 are reserved and must be zero.

## Implements

* [`Parameter`](../interfaces/Parameter.md)

## Constructors

### Constructor

> **new SwitchFrom**(`requestId`, `mode`, `publishDone`): `SwitchFrom`

#### Parameters

##### requestId

`bigint`

##### mode

[`SwitchMode`](../enumerations/SwitchMode.md)

##### publishDone

`boolean`

#### Returns

`SwitchFrom`

## Properties

### mode

> `readonly` **mode**: [`SwitchMode`](../enumerations/SwitchMode.md)

***

### publishDone

> `readonly` **publishDone**: `boolean`

***

### requestId

> `readonly` **requestId**: `bigint`

***

### TYPE

> `readonly` `static` **TYPE**: [`SwitchFrom`](../enumerations/MessageParameterType.md#switchfrom) = `MessageParameterType.SwitchFrom`

## Methods

### toKeyValuePair()

> **toKeyValuePair**(): [`KeyValuePair`](KeyValuePair.md)

#### Returns

[`KeyValuePair`](KeyValuePair.md)

#### Implementation of

[`Parameter`](../interfaces/Parameter.md).[`toKeyValuePair`](../interfaces/Parameter.md#tokeyvaluepair)

***

### fromKeyValuePair()

> `static` **fromKeyValuePair**(`pair`): `SwitchFrom` | `undefined`

#### Parameters

##### pair

[`KeyValuePair`](KeyValuePair.md)

#### Returns

`SwitchFrom` | `undefined`
