# Stackdriver Trace V2 Client - Class MessageEvent (2.0.0)

2.0.0 (latest) 2.0.0-RC1 1.9.5 1.8.10 1.7.0 1.6.5 1.5.3 1.4.11 Reference documentation and code samples for the Stackdriver Trace V2 Client class MessageEvent.

An event describing a message sent/received between Spans.

Generated from protobuf message `google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent`

## Namespace

Google \\ Cloud \\ Trace \\ V2 \\ Span \\ TimeEvent

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ type` | `int` Type of MessageEvent. Indicates whether the message was sent or received. |
| `↳ id` | `int|string` An identifier for the MessageEvent's message that can be used to match `SENT` and `RECEIVED` MessageEvents. |
| `↳ uncompressed_size_bytes` | `int|string` The number of uncompressed bytes sent or received. |
| `↳ compressed_size_bytes` | `int|string` The number of compressed bytes sent or received. If missing, the compressed size is assumed to be the same size as the uncompressed size. |

### getType

Type of MessageEvent. Indicates whether the message was sent or
received.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Type](https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.Span.TimeEvent.MessageEvent.Type). |

### setType

Type of MessageEvent. Indicates whether the message was sent or
received.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Type](https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.Span.TimeEvent.MessageEvent.Type). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getId

An identifier for the MessageEvent's message that can be used to match
`SENT` and `RECEIVED` MessageEvents.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setId

An identifier for the MessageEvent's message that can be used to match
`SENT` and `RECEIVED` MessageEvents.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUncompressedSizeBytes

The number of uncompressed bytes sent or received.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setUncompressedSizeBytes

The number of uncompressed bytes sent or received.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCompressedSizeBytes

The number of compressed bytes sent or received. If missing, the
compressed size is assumed to be the same size as the uncompressed
size.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setCompressedSizeBytes

The number of compressed bytes sent or received. If missing, the
compressed size is assumed to be the same size as the uncompressed
size.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |