# Google Cloud OsConfig V1 Client - Class File (2.2.3)

2.2.3 (latest) 2.2.2 2.1.0 2.0.5 1.3.5 1.2.2 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud OsConfig V1 Client class File.

A remote or local file.

Generated from protobuf message `google.cloud.osconfig.v1.OSPolicy.Resource.File`

## Namespace

Google \\ Cloud \\ OsConfig \\ V1 \\ OSPolicy \\ Resource

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ remote` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicy.Resource.File.Remote` A generic remote file. |
| `↳ gcs` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicy.Resource.File.Gcs` A Cloud Storage object. |
| `↳ local_path` | `string` A local path within the VM to use. |
| `↳ allow_insecure` | `bool` Defaults to false. When false, files are subject to validations based on the file type: Remote: A checksum must be specified. Cloud Storage: An object generation number must be specified. |

### getRemote

A generic remote file.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicy.Resource.File.Remote|null` |   |

### hasRemote

### setRemote

A generic remote file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicy.Resource.File.Remote` |

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

### getGcs

A Cloud Storage object.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicy.Resource.File.Gcs|null` |   |

### hasGcs

### setGcs

A Cloud Storage object.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicy.Resource.File.Gcs` |

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

### getLocalPath

A local path within the VM to use.

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

### hasLocalPath

### setLocalPath

A local path within the VM to use.

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

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

### getAllowInsecure

Defaults to false. When false, files are subject to validations
based on the file type:
Remote: A checksum must be specified.

Cloud Storage: An object generation number must be specified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setAllowInsecure

Defaults to false. When false, files are subject to validations
based on the file type:
Remote: A checksum must be specified.

Cloud Storage: An object generation number must be specified.

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

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

### getType

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