"""API Client for pure ows-features.""" import requests class FeaturesAPIClient: """API Client for ows-features.""" def __init__(self, base_url, headers): """Initialize ows_accounting_APIClient class.""" self.base_url = base_url self.headers = headers def health_check(self): """Health Check.""" endpoint = f'{self.base_url}/hello' return requests.get(endpoint, headers=self.headers, timeout=10) def get_features(self, query=None): """Get features.""" if query is not None: endpoint = f'{self.base_url}/features{query}' else: endpoint = f'{self.base_url}/features' return requests.get(endpoint, headers=self.headers, timeout=10) def get_feature_multiple_context(self): """Get features multiple context.""" endpoint = f'{self.base_url}/features/test_feature_multiple_contexts' return requests.get(endpoint, headers=self.headers, timeout=10) def get_ows_features_example(self): """Get features.""" endpoint = f'{self.base_url}/features/ows_features_example' return requests.get(endpoint, headers=self.headers, timeout=10) def get_features_vendor(self, query): """Get features for Vendor.""" endpoint = f'{self.base_url}/features/vendor{query}' return requests.get(endpoint, headers=self.headers, timeout=10) def get_features_vendor_user(self, query): """Get features for Vendor.""" endpoint = f'{self.base_url}/features/vendor/100/user/alw:{query}' return requests.get(endpoint, headers=self.headers, timeout=10) def get_features_user(self, query): """Get features for Vendor.""" endpoint = f'{self.base_url}/features/user/alw:{query}' return requests.get(endpoint, headers=self.headers, timeout=10) def get_features_user_type(self, query): """Get features for Vendor.""" endpoint = f'{self.base_url}/features/user_type/alw/user_id/{query}' return requests.get(endpoint, headers=self.headers, timeout=10)