# Google Cloud Vision Ai V1 Client - Class PacketHeader (0.3.0)

0.3.0 (latest) 0.2.0 0.1.0 Reference documentation and code samples for the Google Cloud Vision Ai V1 Client class PacketHeader.

The message that represents packet header.

Generated from protobuf message `google.cloud.visionai.v1.PacketHeader`

## Namespace

Google \\ Cloud \\ VisionAI \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ capture_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Input only. The capture time of the packet. |
| `↳ type` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.PacketType` Input only. Immutable. The type of the payload. |
| `↳ metadata` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` Input only. This field is for users to attach user managed metadata. |
| `↳ server_metadata` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.ServerMetadata` Output only. Metadata that the server appends to each packet before sending it to receivers. You don't need to set a value for this field when sending packets. |
| `↳ series_metadata` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.SeriesMetadata` Input only. Immutable. Metadata that the server needs to know where to write the packets to. It's only required for the first packet. |
| `↳ flags` | `int` Immutable. Packet flag set. SDK will set the flag automatically. |
| `↳ trace_context` | `string` Immutable. Header string for tracing across services. It should be set when the packet is first arrived in the stream server. The input format is a lowercase hex string: - version_id: 1 byte, currently must be zero - hex encoded (2 characters) - trace_id: 16 bytes (opaque blob) - hex encoded (32 characters) - span_id: 8 bytes (opaque blob) - hex encoded (16 characters) - trace_options: 1 byte (LSB means tracing enabled) - hex encoded (2 characters) Example: "00-404142434445464748494a4b4c4d4e4f-6162636465666768-01" v trace_id span_id options |

### getCaptureTime

Input only. The capture time of the packet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCaptureTime

### clearCaptureTime

### setCaptureTime

Input only. The capture time of the packet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getType

Input only. Immutable. The type of the payload.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.PacketType|null` |   |

### hasType

### clearType

### setType

Input only. Immutable. The type of the payload.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.PacketType` |

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

### getMetadata

Input only. This field is for users to attach user managed metadata.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct|null` |   |

### hasMetadata

### clearMetadata

### setMetadata

Input only. This field is for users to attach user managed metadata.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` |

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

### getServerMetadata

Output only. Metadata that the server appends to each packet before sending
it to receivers. You don't need to set a value for this field when sending
packets.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.ServerMetadata|null` |   |

### hasServerMetadata

### clearServerMetadata

### setServerMetadata

Output only. Metadata that the server appends to each packet before sending
it to receivers. You don't need to set a value for this field when sending
packets.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.ServerMetadata` |

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

### getSeriesMetadata

Input only. Immutable. Metadata that the server needs to know where to
write the packets to. It's only required for the first packet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.SeriesMetadata|null` |   |

### hasSeriesMetadata

### clearSeriesMetadata

### setSeriesMetadata

Input only. Immutable. Metadata that the server needs to know where to
write the packets to. It's only required for the first packet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.SeriesMetadata` |

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

### getFlags

Immutable. Packet flag set. SDK will set the flag automatically.

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

### setFlags

Immutable. Packet flag set. SDK will set the flag automatically.

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

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

### getTraceContext

Immutable. Header string for tracing across services. It should be set when
the packet is first arrived in the stream server.

The input format is a lowercase hex string:

- version_id: 1 byte, currently must be zero - hex encoded (2 characters)
- trace_id: 16 bytes (opaque blob) - hex encoded (32 characters)
- span_id: 8 bytes (opaque blob) - hex encoded (16 characters)
- trace_options: 1 byte (LSB means tracing enabled) - hex encoded (2 characters) Example: "00-404142434445464748494a4b4c4d4e4f-6162636465666768-01" v trace_id span_id options

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

### setTraceContext

Immutable. Header string for tracing across services. It should be set when
the packet is first arrived in the stream server.

The input format is a lowercase hex string:

- version_id: 1 byte, currently must be zero - hex encoded (2 characters)
- trace_id: 16 bytes (opaque blob) - hex encoded (32 characters)
- span_id: 8 bytes (opaque blob) - hex encoded (16 characters)
- trace_options: 1 byte (LSB means tracing enabled) - hex encoded (2 characters) Example: "00-404142434445464748494a4b4c4d4e4f-6162636465666768-01" v trace_id span_id options

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

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