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



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

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

Returns:

  • (Hash<String,String>)


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

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)


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

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)


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

def create_time
  @create_time
end

#filesArray<String>

Required. The files that blong 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>)


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

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)


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

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)


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

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)


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

def target
  @target
end

#typeString

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

Returns:

  • (String)


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

def type
  @type
end

#update_timeString

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

Returns:

  • (String)


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

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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