Module: Google::Cloud::ApiHub::V1::ApiHubCollect::Paths

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

Overview

Path helper methods for the ApiHubCollect API.

Instance Method Summary collapse

Instance Method Details

#api_operation_path(project:, location:, api:, version:, operation:) ⇒ ::String

Create a fully-qualified ApiOperation resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}

Parameters:

  • project (String)
  • location (String)
  • api (String)
  • version (String)
  • operation (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

def api_operation_path project:, location:, api:, version:, operation:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "api cannot contain /" if api.to_s.include? "/"
  raise ::ArgumentError, "version cannot contain /" if version.to_s.include? "/"

  "projects/#{project}/locations/#{location}/apis/#{api}/versions/#{version}/operations/#{operation}"
end

#api_path(project:, location:, api:) ⇒ ::String

Create a fully-qualified Api resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apis/{api}

Parameters:

  • project (String)
  • location (String)
  • api (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb', line 39

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

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

#attribute_path(project:, location:, attribute:) ⇒ ::String

Create a fully-qualified Attribute resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/attributes/{attribute}

Parameters:

  • project (String)
  • location (String)
  • attribute (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


81
82
83
84
85
86
# File 'lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb', line 81

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

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

#definition_path(project:, location:, api:, version:, definition:) ⇒ ::String

Create a fully-qualified Definition resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}

Parameters:

  • project (String)
  • location (String)
  • api (String)
  • version (String)
  • definition (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


102
103
104
105
106
107
108
109
# File 'lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb', line 102

def definition_path project:, location:, api:, version:, definition:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "api cannot contain /" if api.to_s.include? "/"
  raise ::ArgumentError, "version cannot contain /" if version.to_s.include? "/"

  "projects/#{project}/locations/#{location}/apis/#{api}/versions/#{version}/definitions/#{definition}"
end

#deployment_path(project:, location:, deployment:) ⇒ ::String

Create a fully-qualified Deployment resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/deployments/{deployment}

Parameters:

  • project (String)
  • location (String)
  • deployment (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


123
124
125
126
127
128
# File 'lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb', line 123

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

  "projects/#{project}/locations/#{location}/deployments/#{deployment}"
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)


141
142
143
144
145
# File 'lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb', line 141

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

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

#plugin_instance_path(project:, location:, plugin:, instance:) ⇒ ::String

Create a fully-qualified PluginInstance resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}

Parameters:

  • project (String)
  • location (String)
  • plugin (String)
  • instance (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


160
161
162
163
164
165
166
# File 'lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb', line 160

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

  "projects/#{project}/locations/#{location}/plugins/#{plugin}/instances/#{instance}"
end

#spec_path(project:, location:, api:, version:, spec:) ⇒ ::String

Create a fully-qualified Spec resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

Parameters:

  • project (String)
  • location (String)
  • api (String)
  • version (String)
  • spec (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


182
183
184
185
186
187
188
189
# File 'lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb', line 182

def spec_path project:, location:, api:, version:, spec:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "api cannot contain /" if api.to_s.include? "/"
  raise ::ArgumentError, "version cannot contain /" if version.to_s.include? "/"

  "projects/#{project}/locations/#{location}/apis/#{api}/versions/#{version}/specs/#{spec}"
end

#version_path(project:, location:, api:, version:) ⇒ ::String

Create a fully-qualified Version resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/apis/{api}/versions/{version}

Parameters:

  • project (String)
  • location (String)
  • api (String)
  • version (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


204
205
206
207
208
209
210
# File 'lib/google/cloud/api_hub/v1/api_hub_collect/paths.rb', line 204

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

  "projects/#{project}/locations/#{location}/apis/#{api}/versions/#{version}"
end