Module: Google::Shopping::Merchant::Promotions::V1::PromotionsService::Paths

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

Overview

Path helper methods for the PromotionsService API.

Instance Method Summary collapse

Instance Method Details

#promotion_path(account:, promotion:) ⇒ ::String

Create a fully-qualified Promotion resource string.

The resource will be in the following format:

accounts/{account}/promotions/{promotion}

Parameters:

  • account (String)
  • promotion (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
# File 'lib/google/shopping/merchant/promotions/v1/promotions_service/paths.rb', line 39

def promotion_path account:, promotion:
  raise ::ArgumentError, "account cannot contain /" if .to_s.include? "/"

  "accounts/#{}/promotions/#{promotion}"
end