Class: AmazonAds::Portfolios

Inherits:
API
  • Object
show all
Defined in:
lib/amazon_ads/apis/portfolios.rb

Overview

Portfolios

Constant Summary

Constants inherited from API

API::ENDPOINTS

Instance Attribute Summary

Attributes inherited from API

#access_token, #account_id, #profile_id, #region, #retries

Instance Method Summary collapse

Methods inherited from API

#endpoint, #http, #initialize

Constructor Details

This class inherits a constructor from AmazonAds::API

Instance Method Details

#create_portfolios(portfolios:) ⇒ Object

Signature:

  • (portfolios: Array[untyped]) -> HTTP::Response

RBS:

  • portfolios: Array[untyped] -- An array of portfolio to create.



8
9
10
# File 'lib/amazon_ads/apis/portfolios.rb', line 8

def create_portfolios(portfolios:)
  request(:post, "/portfolios", json: { "portfolios" => portfolios }.compact, headers: { "Content-Type" => "application/vnd.spPortfolio.v3+json", "Accept" => "application/vnd.spPortfolio.v3+json" })
end

#list_portfolios(include_extended_data_fields: nil, name_filter: nil, next_token: nil, portfolio_id_filter: nil, state_filter: nil) ⇒ Object

Signature:

  • (?include_extended_data_fields: bool?, ?name_filter: untyped?, ?next_token: String?, ?portfolio_id_filter: untyped?, ?state_filter: untyped?) -> HTTP::Response

RBS:

  • include_extended_data_fields: bool -- whether to get a list of targetingClauses with extended data fields (creationDate, lastUpdateDate, servingStatus).

  • next_token: String -- token value allowing to navigate to the next response page



15
16
17
# File 'lib/amazon_ads/apis/portfolios.rb', line 15

def list_portfolios(include_extended_data_fields: nil, name_filter: nil, next_token: nil, portfolio_id_filter: nil, state_filter: nil)
  request(:post, "/portfolios/list", json: { "includeExtendedDataFields" => include_extended_data_fields, "nameFilter" => name_filter, "nextToken" => next_token, "portfolioIdFilter" => portfolio_id_filter, "stateFilter" => state_filter }.compact, headers: { "Content-Type" => "application/vnd.spPortfolio.v3+json", "Accept" => "application/vnd.spPortfolio.v3+json" })
end

#portfolio_budget_usage(portfolio_ids: nil) ⇒ Object

Budget usage API for portfolios

Signature:

  • (?portfolio_ids: Array[untyped]?) -> HTTP::Response

RBS:

  • portfolio_ids: Array[untyped] -- A list of portfolio IDs.



22
23
24
# File 'lib/amazon_ads/apis/portfolios.rb', line 22

def portfolio_budget_usage(portfolio_ids: nil)
  request(:post, "/portfolios/budget/usage", json: { "portfolioIds" => portfolio_ids }.compact, headers: { "Content-Type" => "application/vnd.portfoliobudgetusage.v1+json", "Accept" => "application/vnd.portfoliobudgetusage.v1+json" })
end

#update_portfolios(portfolios:) ⇒ Object

Signature:

  • (portfolios: Array[untyped]) -> HTTP::Response

RBS:

  • portfolios: Array[untyped] -- An array of portfolio with updated values.



28
29
30
# File 'lib/amazon_ads/apis/portfolios.rb', line 28

def update_portfolios(portfolios:)
  request(:put, "/portfolios", json: { "portfolios" => portfolios }.compact, headers: { "Content-Type" => "application/vnd.spPortfolio.v3+json", "Accept" => "application/vnd.spPortfolio.v3+json" })
end