Sha256: 0f6cf39bc08b37e2e3266ccfae5e7e9263f8d0c6c2f50e01b27ef0cc704ad382
Contents?: true
Size: 998 Bytes
Versions: 5
Compression:
Stored size: 998 Bytes
Contents
# frozen_string_literal: true module SoapyBing module Soap module Request class PollGenerateReportRequest < Base class FailedStatusError < StandardError; end class PendingStatusError < StandardError; end class PollingTimeoutError < StandardError; end API_BASE_URL = 'https://reporting.api.bingads.microsoft.com' API_VERSION = 9 API_ENDPOINT = "#{API_BASE_URL}/Api/Advertiser/Reporting/V#{API_VERSION}/ReportingService.svc" POLLING_TRIES = 100 def perform Retryable.retryable(tries: POLLING_TRIES, on: PendingStatusError) { poll! } rescue PendingStatusError raise PollingTimeoutError end private def poll! response = Response::PollGenerateReportResponse.new(post(API_ENDPOINT)) raise PendingStatusError if response.pending? raise FailedStatusError if response.error? response end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems