# Device Message

This is a base object contains methods to send unstructured IoT information to be processed & collected by the platform.

## constructor


Constructor

### Parámetros

| Nombre | Tipo | Opcional | Descripción |
| :--- | :--- | :---: | :--- |
| **Reference** | `InternalOpenGateAPI` | ❌ | to the API object. |


---
## withDataStream(datastream)


Set the datastream attribute

### Parámetros

| Nombre | Tipo | Opcional | Descripción |
| :--- | :--- | :---: | :--- |
| **datastream** | `Datastream` | ❌ | required field |

### Retorna

{{% notice tip %}}
**Tipo:** `deviceMessages`
<br>

{{% /notice %}}

---
## withDataStreamVersion(version)


Set the dataStream version attribute

### Parámetros

| Nombre | Tipo | Opcional | Descripción |
| :--- | :--- | :---: | :--- |
| **version** | `string` | ❌ | required field |

### Retorna

{{% notice tip %}}
**Tipo:** `deviceMessages`
<br>

{{% /notice %}}

---
## withDeviceId(deviceId)


Set the deviceId attribute

### Parámetros

| Nombre | Tipo | Opcional | Descripción |
| :--- | :--- | :---: | :--- |
| **deviceId** | `string` | ❌ | optional field |

### Retorna

{{% notice tip %}}
**Tipo:** `deviceMessages`
<br>

{{% /notice %}}

---
## withDmmVersion(version)


Set the version attribute

### Parámetros

| Nombre | Tipo | Opcional | Descripción |
| :--- | :--- | :---: | :--- |
| **version** | `string` | ❌ | required field |

### Retorna

{{% notice tip %}}
**Tipo:** `deviceMessages`
<br>

{{% /notice %}}

---
## withId(id)


Set the id attribute

### Parámetros

| Nombre | Tipo | Opcional | Descripción |
| :--- | :--- | :---: | :--- |
| **id** | `string` | ❌ | required field |

### Retorna

{{% notice tip %}}
**Tipo:** `deviceMessages`
<br>

{{% /notice %}}

---

