Module: Google::Ads::GoogleAds::V15::Services::CampaignAssetService::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/ads/google_ads/v15/services/campaign_asset_service/paths.rb

Overview

Path helper methods for the CampaignAssetService API.

Instance Method Summary collapse

Instance Method Details

#asset_path(customer_id:, asset_id:) ⇒ ::String

Create a fully-qualified Asset resource string.

The resource will be in the following format:

‘customers/customer_id/assets/asset_id`

Parameters:

  • customer_id (String)
  • asset_id (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
# File 'lib/google/ads/google_ads/v15/services/campaign_asset_service/paths.rb', line 39

def asset_path customer_id:, asset_id:
  raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/"

  "customers/#{customer_id}/assets/#{asset_id}"
end

#campaign_asset_path(customer_id:, campaign_id:, asset_id:, field_type:) ⇒ ::String

Create a fully-qualified CampaignAsset resource string.

The resource will be in the following format:

‘customers/customer_id/campaignAssets/campaign_id~asset_id~field_type`

Parameters:

  • customer_id (String)
  • campaign_id (String)
  • asset_id (String)
  • field_type (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


75
76
77
78
79
80
81
# File 'lib/google/ads/google_ads/v15/services/campaign_asset_service/paths.rb', line 75

def campaign_asset_path customer_id:, campaign_id:, asset_id:, field_type:
  raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/"
  raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/"
  raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/"

  "customers/#{customer_id}/campaignAssets/#{campaign_id}~#{asset_id}~#{field_type}"
end

#campaign_path(customer_id:, campaign_id:) ⇒ ::String

Create a fully-qualified Campaign resource string.

The resource will be in the following format:

‘customers/customer_id/campaigns/campaign_id`

Parameters:

  • customer_id (String)
  • campaign_id (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


56
57
58
59
60
# File 'lib/google/ads/google_ads/v15/services/campaign_asset_service/paths.rb', line 56

def campaign_path customer_id:, campaign_id:
  raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/"

  "customers/#{customer_id}/campaigns/#{campaign_id}"
end