Class: Google::Apis::ArtifactregistryV1::Attachment

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/artifactregistry_v1/classes.rb,
lib/google/apis/artifactregistry_v1/representations.rb,
lib/google/apis/artifactregistry_v1/representations.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Attachment

Returns a new instance of Attachment.



163
164
165
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 163

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#annotationsHash<String,String>

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. Corresponds to the JSON property annotations

Returns:

  • (Hash<String,String>)


113
114
115
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 113

def annotations
  @annotations
end

#attachment_namespaceString

The namespace this attachment belongs to. E.g. If an attachment is created by artifact analysis, namespace is set to artifactanalysis.googleapis.com. Corresponds to the JSON property attachmentNamespace

Returns:

  • (String)


119
120
121
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 119

def attachment_namespace
  @attachment_namespace
end

#create_timeString

Output only. The time when the attachment was created. Corresponds to the JSON property createTime

Returns:

  • (String)


124
125
126
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 124

def create_time
  @create_time
end

#filesArray<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:. Corresponds to the JSON property files

Returns:

  • (Array<String>)


131
132
133
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 131

def files
  @files
end

#nameString

The name of the attachment. E.g. projects/p1/locations/us/repositories/repo/ attachments/sbom. Corresponds to the JSON property name

Returns:

  • (String)


137
138
139
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 137

def name
  @name
end

#oci_version_nameString

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. Corresponds to the JSON property ociVersionName

Returns:

  • (String)


144
145
146
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 144

def oci_version_name
  @oci_version_name
end

#targetString

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. Corresponds to the JSON property target

Returns:

  • (String)


151
152
153
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 151

def target
  @target
end

#typeString

Type of attachment. E.g. application/vnd.spdx+json Corresponds to the JSON property type

Returns:

  • (String)


156
157
158
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 156

def type
  @type
end

#update_timeString

Output only. The time when the attachment was last updated. Corresponds to the JSON property updateTime

Returns:

  • (String)


161
162
163
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 161

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



168
169
170
171
172
173
174
175
176
177
178
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 168

def update!(**args)
  @annotations = args[:annotations] if args.key?(:annotations)
  @attachment_namespace = args[:attachment_namespace] if args.key?(:attachment_namespace)
  @create_time = args[:create_time] if args.key?(:create_time)
  @files = args[:files] if args.key?(:files)
  @name = args[:name] if args.key?(:name)
  @oci_version_name = args[:oci_version_name] if args.key?(:oci_version_name)
  @target = args[:target] if args.key?(:target)
  @type = args[:type] if args.key?(:type)
  @update_time = args[:update_time] if args.key?(:update_time)
end