Module: Google::Cloud::Dataplex::V1::MetadataService::Paths

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

Overview

Path helper methods for the MetadataService API.

Instance Method Summary collapse

Instance Method Details

#entity_path(project:, location:, lake:, zone:, entity:) ⇒ ::String

Create a fully-qualified Entity resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}

Parameters:

  • project (String)
  • location (String)
  • lake (String)
  • zone (String)
  • entity (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

def entity_path project:, location:, lake:, zone:, entity:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "lake cannot contain /" if lake.to_s.include? "/"
  raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"

  "projects/#{project}/locations/#{location}/lakes/#{lake}/zones/#{zone}/entities/#{entity}"
end

#partition_path(project:, location:, lake:, zone:, entity:, partition:) ⇒ ::String

Create a fully-qualified Partition resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition}

Parameters:

  • project (String)
  • location (String)
  • lake (String)
  • zone (String)
  • entity (String)
  • partition (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


65
66
67
68
69
70
71
72
73
# File 'lib/google/cloud/dataplex/v1/metadata_service/paths.rb', line 65

def partition_path project:, location:, lake:, zone:, entity:, partition:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "lake cannot contain /" if lake.to_s.include? "/"
  raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"
  raise ::ArgumentError, "entity cannot contain /" if entity.to_s.include? "/"

  "projects/#{project}/locations/#{location}/lakes/#{lake}/zones/#{zone}/entities/#{entity}/partitions/#{partition}"
end

#zone_path(project:, location:, lake:, zone:) ⇒ ::String

Create a fully-qualified Zone resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}

Parameters:

  • project (String)
  • location (String)
  • lake (String)
  • zone (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


88
89
90
91
92
93
94
# File 'lib/google/cloud/dataplex/v1/metadata_service/paths.rb', line 88

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

  "projects/#{project}/locations/#{location}/lakes/#{lake}/zones/#{zone}"
end