Module: Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb

Overview

Path helper methods for the ArtifactRegistry API.

Instance Method Summary collapse

Instance Method Details

#docker_image_path(project:, location:, repository:, docker_image:) ⇒ ::String

Create a fully-qualified DockerImage resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}/dockerImages/{docker_image}

Parameters:

  • project (String)
  • location (String)
  • repository (String)
  • docker_image (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
46
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 40

def docker_image_path project:, location:, repository:, docker_image:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}/dockerImages/#{docker_image}"
end

#file_path(project:, location:, repository:, file:) ⇒ ::String

Create a fully-qualified File resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}/files/{file}

Parameters:

  • project (String)
  • location (String)
  • repository (String)
  • file (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


61
62
63
64
65
66
67
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 61

def file_path project:, location:, repository:, file:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}/files/#{file}"
end

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


80
81
82
83
84
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 80

def location_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/#{location}"
end

#maven_artifact_path(project:, location:, repository:, maven_artifact:) ⇒ ::String

Create a fully-qualified MavenArtifact resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}/mavenArtifacts/{maven_artifact}

Parameters:

  • project (String)
  • location (String)
  • repository (String)
  • maven_artifact (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


99
100
101
102
103
104
105
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 99

def maven_artifact_path project:, location:, repository:, maven_artifact:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}/mavenArtifacts/#{maven_artifact}"
end

#npm_package_path(project:, location:, repository:, npm_package:) ⇒ ::String

Create a fully-qualified NpmPackage resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}/npmPackages/{npm_package}

Parameters:

  • project (String)
  • location (String)
  • repository (String)
  • npm_package (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


120
121
122
123
124
125
126
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 120

def npm_package_path project:, location:, repository:, npm_package:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}/npmPackages/#{npm_package}"
end

#package_path(project:, location:, repository:, package:) ⇒ ::String

Create a fully-qualified Package resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}/packages/{package}

Parameters:

  • project (String)
  • location (String)
  • repository (String)
  • package (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


141
142
143
144
145
146
147
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 141

def package_path project:, location:, repository:, package:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}/packages/#{package}"
end

#project_settings_path(project:) ⇒ ::String

Create a fully-qualified ProjectSettings resource string.

The resource will be in the following format:

projects/{project}/projectSettings

Parameters:

  • project (String)

Returns:

  • (::String)


159
160
161
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 159

def project_settings_path project:
  "projects/#{project}/projectSettings"
end

#python_package_path(project:, location:, repository:, python_package:) ⇒ ::String

Create a fully-qualified PythonPackage resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}/pythonPackages/{python_package}

Parameters:

  • project (String)
  • location (String)
  • repository (String)
  • python_package (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


176
177
178
179
180
181
182
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 176

def python_package_path project:, location:, repository:, python_package:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}/pythonPackages/#{python_package}"
end

#repository_path(project:, location:, repository:) ⇒ ::String

Create a fully-qualified Repository resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}

Parameters:

  • project (String)
  • location (String)
  • repository (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


196
197
198
199
200
201
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 196

def repository_path project:, location:, repository:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}"
end

#secret_version_path(project:, secret:, secret_version:) ⇒ ::String

Create a fully-qualified SecretVersion resource string.

The resource will be in the following format:

projects/{project}/secrets/{secret}/versions/{secret_version}

Parameters:

  • project (String)
  • secret (String)
  • secret_version (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


215
216
217
218
219
220
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 215

def secret_version_path project:, secret:, secret_version:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/"

  "projects/#{project}/secrets/#{secret}/versions/#{secret_version}"
end

#tag_path(project:, location:, repository:, package:, tag:) ⇒ ::String

Create a fully-qualified Tag resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}

Parameters:

  • project (String)
  • location (String)
  • repository (String)
  • package (String)
  • tag (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


236
237
238
239
240
241
242
243
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 236

def tag_path project:, location:, repository:, package:, tag:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/"
  raise ::ArgumentError, "package cannot contain /" if package.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}/packages/#{package}/tags/#{tag}"
end

#version_path(project:, location:, repository:, package:, version:) ⇒ ::String

Create a fully-qualified Version resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}

Parameters:

  • project (String)
  • location (String)
  • repository (String)
  • package (String)
  • version (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


259
260
261
262
263
264
265
266
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 259

def version_path project:, location:, repository:, package:, version:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/"
  raise ::ArgumentError, "package cannot contain /" if package.to_s.include? "/"

  "projects/#{project}/locations/#{location}/repositories/#{repository}/packages/#{package}/versions/#{version}"
end

#vpcsc_config_path(project:, location:) ⇒ ::String

Create a fully-qualified VpcscConfig resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/vpcscConfig

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


279
280
281
282
283
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb', line 279

def vpcsc_config_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/#{location}/vpcscConfig"
end