Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from abc import abstractmethod 

2 

3from sdc_etl_libs.api_helpers.OAuthAPI import OAuthAPI 

4 

5 

6class AsyncOAuthAPI(OAuthAPI): 

7 """ 

8 Abstract class representing OAuth process for Async APIs. Async means the API doesn't return data as the body of 

9 the response, but usually a URL pointing to a data file to be downloaded. 

10 """ 

11 

12 def __init__(self, 

13 authorization_token_=None, 

14 refresh_token_=None, 

15 access_token_=None, 

16 client_id_=None, 

17 client_secret_=None, 

18 credential_id_=None, 

19 region_="us-east-2"): 

20 super(AsyncOAuthAPI, self).__init__(authorization_token_=authorization_token_, 

21 refresh_token_=refresh_token_, 

22 access_token_=access_token_, 

23 client_id_=client_id_, 

24 client_secret_=client_secret_, 

25 credential_id_=credential_id_, 

26 region_=region_) 

27 

28 @abstractmethod 

29 def check_data_request_status(self, request_id=None): 

30 """ 

31 Given a valid customer_report_id obtained from a previously submitted data report request, return the status of 

32 the report process. In case of Success it will inform a url pointing to the digital file containing the data to 

33 be downloaded. 

34 Usually this method is implemented and decorated with a @retry function to handle tokens refresh logic. 

35 

36 Ref.: https://developer.verizonmedia.com/dsp/api/docs/reporting/payloadspec.html#id13 

37 

38 Args: 

39 request_id(str): id of the target report submission 

40 

41 Returns: 

42 submission_status: ReportSubmissionStatus object wrapping the status response payload. 

43 """ 

44 raise NotImplementedError("Please Implement this method")