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

1 

2from abc import ABCMeta, abstractmethod 

3from sdc_etl_libs.sdc_credentials.sdc_endpoint_credentials import SDCEndpointCredentials 

4 

5 

6class SDCDataExchangeEndpoint(metaclass=ABCMeta): 

7 

8 def create_exchange_endpoint(self): 

9 raise Exception("Do not use base class implementation of create_exchange_endpoint.") 

10 

11 def get_data_as_file_object(self): 

12 raise Exception("Do not use base class implementation of get_data_as_file_object.") 

13 

14 def write_file(self, file_name_, file_object_): 

15 raise Exception("Do not use base class implementation of write_file.") 

16 

17 def write_dataframe(self, sdcdf_, **kwargs): 

18 raise Exception("Do not use base class implementation of write_dataframe.") 

19 

20 def grab_credentials(self) -> dict: 

21 """ 

22 Checks for credentials store information in the class's endpoint schema and triggers the proper 

23 method for grabbing credentials. 

24 :return: Dict or None. Credentials (if available and accessible). 

25 """ 

26 

27 creds = None 

28 if "credentials" in self.endpoint_schema["info"]["access"]: 

29 if self.endpoint_schema["info"]["access"]["credentials"] is not None: 

30 creds = SDCEndpointCredentials.get_credentials(self.endpoint_schema["info"]["access"]["credentials"]) 

31 return creds