# Google Cloud Network Connectivity V1 Client - Class StateMetadata (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.0 2.2.2 2.1.2 2.0.2 1.5.5 1.4.2 1.3.0 1.2.0 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Network Connectivity V1 Client class StateMetadata.

The state and activation time details of the resource state.

Generated from protobuf message `google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata`

## Namespace

Google \\ Cloud \\ NetworkConnectivity \\ V1 \\ StateTimeline

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ state` | `int` Output only. The state of the resource. |
| `↳ effective_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Accompanies only the transient states, which include `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which the transient state of the resource will be effective. For instance, if the state is `ADDING`, this field shows the time when the resource state transitions to `ACTIVE`. |

### getState

Output only. The state of the resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.StateTimeline.StateMetadata.State). |

### setState

Output only. The state of the resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.StateTimeline.StateMetadata.State). |

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

### getEffectiveTime

Output only. Accompanies only the transient states, which include
`ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
the transient state of the resource will be effective. For instance, if
the state is `ADDING`, this field shows the time when the resource state
transitions to `ACTIVE`.

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

### hasEffectiveTime

### clearEffectiveTime

### setEffectiveTime

Output only. Accompanies only the transient states, which include
`ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
the transient state of the resource will be effective. For instance, if
the state is `ADDING`, this field shows the time when the resource state
transitions to `ACTIVE`.

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

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