Module: Google::Shopping::Merchant::Inventories::V1::LocalInventoryService::Paths

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

Overview

Path helper methods for the LocalInventoryService API.

Instance Method Summary collapse

Instance Method Details

#local_inventory_path(account:, product:, store_code:) ⇒ ::String

Create a fully-qualified LocalInventory resource string.

The resource will be in the following format:

accounts/{account}/products/{product}/localInventories/{store_code}

Parameters:

  • account (String)
  • product (String)
  • store_code (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
# File 'lib/google/shopping/merchant/inventories/v1/local_inventory_service/paths.rb', line 40

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

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

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


58
59
60
61
62
# File 'lib/google/shopping/merchant/inventories/v1/local_inventory_service/paths.rb', line 58

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

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