Module: Google::Cloud::ApiHub::V1::LintingService::Paths

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

Overview

Path helper methods for the LintingService API.

Instance Method Summary collapse

Instance Method Details

#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)


41
42
43
44
45
46
47
48
# File 'lib/google/cloud/api_hub/v1/linting_service/paths.rb', line 41

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

#style_guide_path(project:, location:, plugin:) ⇒ ::String

Create a fully-qualified StyleGuide resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/plugins/{plugin}/styleGuide

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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