Module: Google::Cloud::Vision::V1::ProductSearch::Paths

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

Overview

Path helper methods for the ProductSearch API.

Instance Method Summary collapse

Instance Method Details

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


38
39
40
41
42
# File 'lib/google/cloud/vision/v1/product_search/paths.rb', line 38

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

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

#product_path(project:, location:, product:) ⇒ ::String

Create a fully-qualified Product resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/products/{product}

Parameters:

  • project (String)
  • location (String)
  • product (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


56
57
58
59
60
61
# File 'lib/google/cloud/vision/v1/product_search/paths.rb', line 56

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

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

#product_set_path(project:, location:, product_set:) ⇒ ::String

Create a fully-qualified ProductSet resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/productSets/{product_set}

Parameters:

  • project (String)
  • location (String)
  • product_set (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


75
76
77
78
79
80
# File 'lib/google/cloud/vision/v1/product_search/paths.rb', line 75

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

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

#reference_image_path(project:, location:, product:, reference_image:) ⇒ ::String

Create a fully-qualified ReferenceImage resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}

Parameters:

  • project (String)
  • location (String)
  • product (String)
  • reference_image (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


95
96
97
98
99
100
101
# File 'lib/google/cloud/vision/v1/product_search/paths.rb', line 95

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

  "projects/#{project}/locations/#{location}/products/#{product}/referenceImages/#{reference_image}"
end