Class: AmazonAds::LocationIndexes
- Defined in:
- lib/amazon_ads/apis/location_indexes.rb
Constant Summary
Constants inherited from API
Instance Attribute Summary
Attributes inherited from API
#access_token, #account_id, #profile_id, #region, #retries
Instance Method Summary collapse
-
#create_location_index(location_indexes:) ⇒ Object
Create a Smart Location Index.
-
#list_location_index(next_token: nil, max_results: nil) ⇒ Object
List all Smart Location Indexes for the authenticated advertiser.
-
#retrieve_location_index(index_ids:) ⇒ Object
Retrieve one or more Smart Location Indexes by ID.
-
#update_location_index(location_indexes:) ⇒ Object
Update the data for an existing Smart Location Index.
Methods inherited from API
Constructor Details
This class inherits a constructor from AmazonAds::API
Instance Method Details
#create_location_index(location_indexes:) ⇒ Object
Create a Smart Location Index. A Smart Location Index is a named dataset that maps postal codes to index values representing relative audience quality or sales potential for a given advertiser. Index data is processed asynchronously; the index status will transition from PENDING to ENABLED once processing is complete.
7 8 9 |
# File 'lib/amazon_ads/apis/location_indexes.rb', line 7 def create_location_index(location_indexes:) request(:post, "/adsApi/v1/create/locationIndexes", json: { "locationIndexes" => location_indexes }.compact) end |
#list_location_index(next_token: nil, max_results: nil) ⇒ Object
List all Smart Location Indexes for the authenticated advertiser. Returns a paginated collection of indexes including their current processing status. Use the nextToken from the response to retrieve subsequent pages.
13 14 15 |
# File 'lib/amazon_ads/apis/location_indexes.rb', line 13 def list_location_index(next_token: nil, max_results: nil) request(:get, "/adsApi/v1/locationIndexes", params: { "nextToken" => next_token, "maxResults" => max_results }.compact) end |
#retrieve_location_index(index_ids:) ⇒ Object
Retrieve one or more Smart Location Indexes by ID. Returns the current metadata and processing status for each requested index. An index with status PENDING is still being processed and is not yet available for use in smart location targeting.
19 20 21 |
# File 'lib/amazon_ads/apis/location_indexes.rb', line 19 def retrieve_location_index(index_ids:) request(:post, "/adsApi/v1/retrieve/locationIndexes", json: { "indexIds" => index_ids }.compact) end |
#update_location_index(location_indexes:) ⇒ Object
Update the data for an existing Smart Location Index. Replaces the index's postal code values with the provided dataset. The update is processed asynchronously; the index status will return to PENDING until the new data has been fully processed.
25 26 27 |
# File 'lib/amazon_ads/apis/location_indexes.rb', line 25 def update_location_index(location_indexes:) request(:post, "/adsApi/v1/update/locationIndexes", json: { "locationIndexes" => location_indexes }.compact) end |