Module: Google::Cloud::AIPlatform::V1::FeaturestoreService::Paths

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

Overview

Path helper methods for the FeaturestoreService API.

Instance Method Summary collapse

Instance Method Details

#entity_type_path(project:, location:, featurestore:, entity_type:) ⇒ ::String

Create a fully-qualified EntityType resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}

Parameters:

  • project (String)
  • location (String)
  • featurestore (String)
  • entity_type (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

  "projects/#{project}/locations/#{location}/featurestores/#{featurestore}/entityTypes/#{entity_type}"
end

#feature_group_path(project:, location:, feature_group:) ⇒ ::String

Create a fully-qualified FeatureGroup resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/featureGroups/{feature_group}

Parameters:

  • project (String)
  • location (String)
  • feature_group (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


109
110
111
112
113
114
# File 'lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb', line 109

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

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

#feature_path(project: , location: , featurestore: , entity_type: , feature: ) ⇒ ::String #feature_path(project: , location: , feature_group: , feature: ) ⇒ ::String

Create a fully-qualified Feature resource string.

Overloads:

  • #feature_path(project: , location: , featurestore: , entity_type: , feature: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • featurestore (String) (defaults to: )
    • entity_type (String) (defaults to: )
    • feature (String) (defaults to: )
  • #feature_path(project: , location: , feature_group: , feature: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • feature_group (String) (defaults to: )
    • feature (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb', line 73

def feature_path **args
  resources = {
    "entity_type:feature:featurestore:location:project" => (proc do |project:, location:, featurestore:, entity_type:, feature:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "featurestore cannot contain /" if featurestore.to_s.include? "/"
      raise ::ArgumentError, "entity_type cannot contain /" if entity_type.to_s.include? "/"

      "projects/#{project}/locations/#{location}/featurestores/#{featurestore}/entityTypes/#{entity_type}/features/#{feature}"
    end),
    "feature:feature_group:location:project" => (proc do |project:, location:, feature_group:, feature:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "feature_group cannot contain /" if feature_group.to_s.include? "/"

      "projects/#{project}/locations/#{location}/featureGroups/#{feature_group}/features/#{feature}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end

#featurestore_path(project:, location:, featurestore:) ⇒ ::String

Create a fully-qualified Featurestore resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/featurestores/{featurestore}

Parameters:

  • project (String)
  • location (String)
  • featurestore (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


128
129
130
131
132
133
# File 'lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb', line 128

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

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


146
147
148
149
150
# File 'lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb', line 146

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

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