# Artifact Registry v1 API - Class Attachment (2.15.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.15.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.14.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.14.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.13.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.13.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.12.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.12.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.11.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.11.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.10.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.10.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.9.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.9.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.8.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.7.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.6.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.5.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.4.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.3.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.2.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.1.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/2.0.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/1.1.0/Google.Cloud.ArtifactRegistry.V1.Attachment)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/1.0.0/Google.Cloud.ArtifactRegistry.V1.Attachment)

    public sealed class Attachment : IMessage<Attachment>, IEquatable<Attachment>, IDeepCloneable<Attachment>, IBufferMessage, IMessage

Reference documentation and code samples for the Artifact Registry v1 API 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.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> Attachment

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Attachment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.Attachment), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Attachment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.Attachment), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Attachment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.Attachment), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.ArtifactRegistry.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1)

## Assembly

Google.Cloud.ArtifactRegistry.V1.dll

## Constructors

### Attachment()

    public Attachment()

### Attachment(Attachment)

    public Attachment(Attachment other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.Attachment` |

## Properties

### Annotations

    public MapField<string, string> Annotations { get; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.MapField-2.htmlhttps://learn.microsoft.com/dotnet/api/system.stringhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### AttachmentName

    public AttachmentName AttachmentName { get; set; }

[AttachmentName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.AttachmentName)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.Attachment#Google_Cloud_ArtifactRegistry_V1_Attachment_Name) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.AttachmentName` |   |

### AttachmentNamespace

    public string AttachmentNamespace { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### CreateTime

    public Timestamp CreateTime { get; set; }

Output only. The time when the attachment was created.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### Files

    public RepeatedField<string> Files { get; }

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>`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### FilesAsFileNames

    public ResourceNameList<FileName> FilesAsFileNames { get; }

[FileName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.FileName)-typed view over the [Files](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.Attachment#Google_Cloud_ArtifactRegistry_V1_Attachment_Files) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNameList-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ArtifactRegistry.V1/latest/Google.Cloud.ArtifactRegistry.V1.FileName` |   |

### Name

    public string Name { get; set; }

The name of the attachment. E.g.
`projects/p1/locations/us/repositories/repo/attachments/sbom`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### OciVersionName

    public string OciVersionName { get; set; }

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`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Target

    public string Target { get; set; }

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`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Type

    public string Type { get; set; }

Type of attachment.
E.g. `application/vnd.spdx+json`

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### UpdateTime

    public Timestamp UpdateTime { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |