SearchAdRequest.Builder

public static final class SearchAdRequest.Builder extends Object

Builds a SearchAdRequest.

Public Constructor Summary

Public Method Summary

SearchAdRequest
build()
Constructs a SearchAdRequest with the specified attributes.
SearchAdRequest.Builder
setPriceCurrency(String priceCurrency)
Sets the price currency (as case-insensitive three-letter ISO currency code) to use for filtering products by price with setPriceMin(String) and/or setPriceMax(String) (optional).
SearchAdRequest.Builder
setPriceMax(String priceMax)
Sets the maximum product price (in the currency specified with setPriceCurrency(String)) for ads to be returned (optional).
SearchAdRequest.Builder
setPriceMin(String priceMin)
Sets the minimum product price (in the currency specified with setPriceCurrency(String)) for ads to be returned (optional).
SearchAdRequest.Builder
setQuery(String query)
Sets the query entered by the user (required).
SearchAdRequest.Builder
setTestGeolocation(String testGeolocation)
For testing purposes, sets the user's location to return location-targeted shopping ads (optional).

Inherited Method Summary

Public Constructors

public SearchAdRequest.Builder ()

Public Methods

public SearchAdRequest build ()

Constructs a SearchAdRequest with the specified attributes.

public SearchAdRequest.Builder setPriceCurrency (String priceCurrency)

Sets the price currency (as case-insensitive three-letter ISO currency code) to use for filtering products by price with setPriceMin(String) and/or setPriceMax(String) (optional).

Only valid for Sponsored Product Ads (SPA). Must be specified if setPriceMin(String) or setPriceMax(String) is set. The price filter will not be applied if the provided currency code does not match the currency of the returned ads.

Parameters
priceCurrency

public SearchAdRequest.Builder setPriceMax (String priceMax)

Sets the maximum product price (in the currency specified with setPriceCurrency(String)) for ads to be returned (optional).

Only valid for Sponsored Product Ads (SPA). setPriceCurrency(String) must be set if this option is specified. The price filter will not be applied if the provided currency code does not match the currency of the returned ads.

The given price should contain only numeric characters and periods (e.g. "19.95") and must not contain currency symbols (e.g. "$") or commas (",").

Parameters
priceMax

public SearchAdRequest.Builder setPriceMin (String priceMin)

Sets the minimum product price (in the currency specified with setPriceCurrency(String)) for ads to be returned (optional).

Only valid for Sponsored Product Ads (SPA). setPriceCurrency(String) must be set if this option is specified. The price filter will not be applied if the provided currency code does not match the currency of the returned ads.

The given price should contain only numeric characters and periods (e.g. "19.95") and must not contain currency symbols (e.g. "$") or commas (",").

Parameters
priceMin

public SearchAdRequest.Builder setQuery (String query)

Sets the query entered by the user (required).

Must not be empty. Should not be URL-encoded.

Parameters
query

public SearchAdRequest.Builder setTestGeolocation (String testGeolocation)

For testing purposes, sets the user's location to return location-targeted shopping ads (optional).

Only valid for AdSense for Shopping (AFSh) ads with adtest on. Provide the two-letter country code, case-insensitive.

Parameters
testGeolocation