Module: Google::Cloud::ServiceDirectory::V1::RegistrationService::Paths

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

Overview

Path helper methods for the RegistrationService API.

Instance Method Summary collapse

Instance Method Details

#endpoint_path(project:, location:, namespace:, service:, endpoint:) ⇒ ::String

Create a fully-qualified Endpoint resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}

Parameters:

  • project (String)
  • location (String)
  • namespace (String)
  • service (String)
  • endpoint (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

def endpoint_path project:, location:, namespace:, service:, endpoint:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/"
  raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/"

  "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}/endpoints/#{endpoint}"
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)


61
62
63
64
65
# File 'lib/google/cloud/service_directory/v1/registration_service/paths.rb', line 61

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

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

#namespace_path(project:, location:, namespace:) ⇒ ::String

Create a fully-qualified Namespace resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/namespaces/{namespace}

Parameters:

  • project (String)
  • location (String)
  • namespace (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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

#network_path(project:, network:) ⇒ ::String

Create a fully-qualified Network resource string.

The resource will be in the following format:

projects/{project}/locations/global/networks/{network}

Parameters:

  • project (String)
  • network (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


97
98
99
100
101
# File 'lib/google/cloud/service_directory/v1/registration_service/paths.rb', line 97

def network_path project:, network:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/global/networks/#{network}"
end

#service_path(project:, location:, namespace:, service:) ⇒ ::String

Create a fully-qualified Service resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}

Parameters:

  • project (String)
  • location (String)
  • namespace (String)
  • service (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


116
117
118
119
120
121
122
# File 'lib/google/cloud/service_directory/v1/registration_service/paths.rb', line 116

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

  "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}"
end