"""Ows notifications.""" from owsrequest import request from config import ENVIRONMENT def get_notification_settings(profile_id, profile_type): """Get notification settings for a profile. Args: profile_type (str): profile type (e.g. LabelProfile). profile_id (id): profile id. Returns: list[dict]: a list of notification settings. """ response = request.process( 'lambda-notifications-publish-message', ENVIRONMENT, 'GET', 'ows-notifications', f'/profile/profile_id/{profile_id}' f'/profile_type/{profile_type}/notifications' ) settings = [] if response.status_code == 200: settings = response.json() if response.status_code not in [200, 404]: raise Exception( f'unexpected HTTP response status {response.status_code}') return settings