"""Product logic.""" from oto import response from owsrequest import request as requests from promo_player.constants import service_name def is_owner(product_id, account_type, account_id): """Get ownership of a product for account type and account ID. Args: product_id (int): the product ID. account_type (str): the account type (vendor or subaccount). account_id (str): the account ID. Returns: response.Response: Indicates whether the account owns the product. """ path = '/{account_type}/{account_id}/product/{product_id}'.format( account_type=account_type, account_id=account_id, product_id=product_id) result = requests.head(service_name.OWS_PRODUCT, path) return response.Response(status=result.status_code)