# Google Cloud Asset V1 Client - Class VersionedResource (2.3.3)

2.3.3 (latest) 2.3.2 2.2.3 2.1.3 2.0.1 1.16.4 1.14.1 1.13.2 1.12.2 1.11.3 1.10.2 1.9.2 Reference documentation and code samples for the Google Cloud Asset V1 Client class VersionedResource.

Resource representation as defined by the corresponding service providing the
resource for a given API version.

Generated from protobuf message `google.cloud.asset.v1.VersionedResource`

## Namespace

Google \\ Cloud \\ Asset \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ version` | `string` API version of the resource. Example: If the resource is an instance provided by Compute Engine v1 API as defined in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`, version will be "v1". |
| `↳ resource` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` JSON representation of the resource as defined by the corresponding service providing this resource. Example: If the resource is an instance provided by Compute Engine, this field will contain the JSON representation of the instance as defined by Compute Engine: `https://cloud.google.com/compute/docs/reference/rest/v1/instances`. You can find the resource definition for each supported resource type in this table: `https://cloud.google.com/asset-inventory/docs/supported-asset-types` |

### getVersion

API version of the resource.

Example:
If the resource is an instance provided by Compute Engine v1 API as defined
in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`,
version will be "v1".

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

### setVersion

API version of the resource.

Example:
If the resource is an instance provided by Compute Engine v1 API as defined
in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`,
version will be "v1".

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

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

### getResource

JSON representation of the resource as defined by the corresponding
service providing this resource.

Example:
If the resource is an instance provided by Compute Engine, this field will
contain the JSON representation of the instance as defined by Compute
Engine:
`https://cloud.google.com/compute/docs/reference/rest/v1/instances`.
You can find the resource definition for each supported resource type in
this table:
`https://cloud.google.com/asset-inventory/docs/supported-asset-types`

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

### hasResource

### clearResource

### setResource

JSON representation of the resource as defined by the corresponding
service providing this resource.

Example:
If the resource is an instance provided by Compute Engine, this field will
contain the JSON representation of the instance as defined by Compute
Engine:
`https://cloud.google.com/compute/docs/reference/rest/v1/instances`.
You can find the resource definition for each supported resource type in
this table:
`https://cloud.google.com/asset-inventory/docs/supported-asset-types`

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

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