1.8.4 (latest) 1.7.2 1.6.0 1.5.0 1.4.0 1.3.1 1.2.1 1.1.3 1.0.0 0.6.5 0.5.1 0.4.4 0.3.13 Reference documentation and code samples for the Google Cloud Artifact Registry V1 Client class Attachment.

An Attachment refers to additional metadata that can be attached to
artifacts in Artifact Registry. An attachment consists of one or more files.

Generated from protobuf message `google.devtools.artifactregistry.v1.Attachment`

## Namespace

Google \\ Cloud \\ ArtifactRegistry \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` The name of the attachment. E.g. `projects/p1/locations/us/repositories/repo/attachments/sbom`. |
| `↳ target` | `string` Required. The target the attachment is for, can be a Version, Package or Repository. E.g. `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. |
| `↳ type` | `string` Type of attachment. E.g. `application/vnd.spdx+json` |
| `↳ attachment_namespace` | `string` The namespace this attachment belongs to. E.g. If an attachment is created by artifact analysis, namespace is set to `artifactanalysis.googleapis.com`. |
| `↳ annotations` | `array|Google\Protobuf\Internal\MapField` Optional. User annotations. These attributes can only be set and used by the user, and not by Artifact Registry. See <https://google.aip.dev/128#annotations> for more details such as format and size limitations. |
| `↳ create_time` | `Google\Protobuf\Timestamp` Output only. The time when the attachment was created. |
| `↳ update_time` | `Google\Protobuf\Timestamp` Output only. The time when the attachment was last updated. |
| `↳ files` | `string[]` Required. The files that belong to this attachment. If the file ID part contains slashes, they are escaped. E.g. `projects/p1/locations/us-central1/repositories/repo1/files/sha:<sha-of-file>`. |
| `↳ oci_version_name` | `string` Output only. The name of the OCI version that this attachment created. Only populated for Docker attachments. E.g. `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. |

### getName

The name of the attachment. E.g.

`projects/p1/locations/us/repositories/repo/attachments/sbom`.

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

### setName

The name of the attachment. E.g.

`projects/p1/locations/us/repositories/repo/attachments/sbom`.

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

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

### getTarget

Required. The target the attachment is for, can be a Version, Package or
Repository. E.g.

`projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.

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

### setTarget

Required. The target the attachment is for, can be a Version, Package or
Repository. E.g.

`projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.

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

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

### getType

Type of attachment.

E.g. `application/vnd.spdx+json`

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

### setType

Type of attachment.

E.g. `application/vnd.spdx+json`

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

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

### getAttachmentNamespace

The namespace this attachment belongs to.

E.g. If an attachment is created by artifact analysis, namespace is set
to `artifactanalysis.googleapis.com`.

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

### setAttachmentNamespace

The namespace this attachment belongs to.

E.g. If an attachment is created by artifact analysis, namespace is set
to `artifactanalysis.googleapis.com`.

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

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

### getAnnotations

Optional. User annotations. These attributes can only be set and used by
the user, and not by Artifact Registry. See
<https://google.aip.dev/128#annotations> for more details such as format and
size limitations.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Internal\MapField` |   |

### setAnnotations

Optional. User annotations. These attributes can only be set and used by
the user, and not by Artifact Registry. See
<https://google.aip.dev/128#annotations> for more details such as format and
size limitations.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|Google\Protobuf\Internal\MapField` |

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

### getCreateTime

Output only. The time when the attachment was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time when the attachment was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

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

### getUpdateTime

Output only. The time when the attachment was last updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The time when the attachment was last updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

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

### getFiles

Required. The files that belong to this attachment.

If the file ID part contains slashes, they are escaped. E.g.
`projects/p1/locations/us-central1/repositories/repo1/files/sha:<sha-of-file>`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<string>` |   |

### setFiles

Required. The files that belong to this attachment.

If the file ID part contains slashes, they are escaped. E.g.
`projects/p1/locations/us-central1/repositories/repo1/files/sha:<sha-of-file>`.

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

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

### getOciVersionName

Output only. The name of the OCI version that this attachment created. Only
populated for Docker attachments. E.g.

`projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.

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

### setOciVersionName

Output only. The name of the OCI version that this attachment created. Only
populated for Docker attachments. E.g.

`projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.

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

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