Class: SoapyBing::Ads::Bulk::Campaigns
- Inherits:
-
Object
- Object
- SoapyBing::Ads::Bulk::Campaigns
- Defined in:
- lib/soapy_bing/ads/bulk/campaigns.rb
Constant Summary collapse
- DEFAULT_ENTITIES =
%w(CampaignTargets Ads).freeze
- POLLING_TRIES =
30
- NotCompleted =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#entities ⇒ Object
readonly
Returns the value of attribute entities.
-
#oauth_credentials ⇒ Object
readonly
Returns the value of attribute oauth_credentials.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #fetch_status ⇒ Object
-
#initialize(options) ⇒ Campaigns
constructor
A new instance of Campaigns.
- #result_file_url ⇒ Object
- #rows ⇒ Object
Constructor Details
#initialize(options) ⇒ Campaigns
Returns a new instance of Campaigns.
12 13 14 15 16 |
# File 'lib/soapy_bing/ads/bulk/campaigns.rb', line 12 def initialize() @oauth_credentials = .fetch(:oauth_credentials) @account = .fetch(:account) @entities = .fetch(:entities) || DEFAULT_ENTITIES end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
10 11 12 |
# File 'lib/soapy_bing/ads/bulk/campaigns.rb', line 10 def account @account end |
#entities ⇒ Object (readonly)
Returns the value of attribute entities.
10 11 12 |
# File 'lib/soapy_bing/ads/bulk/campaigns.rb', line 10 def entities @entities end |
#oauth_credentials ⇒ Object (readonly)
Returns the value of attribute oauth_credentials.
10 11 12 |
# File 'lib/soapy_bing/ads/bulk/campaigns.rb', line 10 def oauth_credentials @oauth_credentials end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
10 11 12 |
# File 'lib/soapy_bing/ads/bulk/campaigns.rb', line 10 def status @status end |
Instance Method Details
#fetch_status ⇒ Object
29 30 31 32 33 34 |
# File 'lib/soapy_bing/ads/bulk/campaigns.rb', line 29 def fetch_status @status = Soap::Request::GetBulkDownloadStatusRequest .new(context: context.merge(request_id: download_request_id)) .perform .payload end |
#result_file_url ⇒ Object
22 23 24 25 26 27 |
# File 'lib/soapy_bing/ads/bulk/campaigns.rb', line 22 def result_file_url @result_file_url ||= begin wait_status_complete status['ResultFileUrl'] end end |