Module: Google::Shopping::Merchant::Inventories::V1beta::RegionalInventoryService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/paths.rb

Overview

Path helper methods for the RegionalInventoryService API.

Instance Method Summary collapse

Instance Method Details

#product_path(account:, product:) ⇒ ::String

Create a fully-qualified Product resource string.

The resource will be in the following format:

accounts/{account}/products/{product}

Parameters:

  • account (String)
  • product (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
# File 'lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/paths.rb', line 39

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

  "accounts/#{}/products/#{product}"
end

#regional_inventory_path(account:, product:, region:) ⇒ ::String

Create a fully-qualified RegionalInventory resource string.

The resource will be in the following format:

accounts/{account}/products/{product}/regionalInventories/{region}

Parameters:

  • account (String)
  • product (String)
  • region (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


57
58
59
60
61
62
# File 'lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/paths.rb', line 57

def regional_inventory_path account:, product:, region:
  raise ::ArgumentError, "account cannot contain /" if .to_s.include? "/"
  raise ::ArgumentError, "product cannot contain /" if product.to_s.include? "/"

  "accounts/#{}/products/#{product}/regionalInventories/#{region}"
end