"""Model for ows-carveouts-python.""" from owsrequest import request from abacus_legacy_sync.config import Config from abacus_legacy_sync.constants import services def get_account_carveouts(account_id): """Get a Carveouts for account.""" carveouts_response = request.process( application=Config.SERVICE_NAME, environment=Config.ENVIRONMENT, method='GET', service_name=services.OWS_CARVEOUTS_PYTHON, uwsgi_cache_enabled=True, path=f'/delivery-restrictions/account/{account_id}', ) carveouts_response.raise_for_status() return carveouts_response.json() def save_account_carveouts(account_id, post_data): """Save carveouts for product.""" carveouts_response = request.process( application=Config.SERVICE_NAME, environment=Config.ENVIRONMENT, method='POST', service_name=services.OWS_CARVEOUTS_PYTHON, uwsgi_cache_enabled=True, path=f'/delivery-restrictions/account/{account_id}', json=post_data, ) carveouts_response.raise_for_status()