"""Interface to ows-product microservice.""" from owsrequest import request from conflict_manager.constants import services from conflict_manager.utils import service_utils def get_product_by_product_id(product_id): """Get information about product by id. Args: product_id (int): product identifier Returns: oto.response.Response: response object with product info or error """ endpoint = '/product/{}'.format(product_id) return service_utils.get_from_ows_service(services.OWS_PRODUCT, endpoint) def get_multiple_products_by_upcs(upcs): """Get multiple products by a list of upcs. Args: upcs (list): List of UPCs Returns: oto.response.Response: response object with product info or error """ res = request.post(services.OWS_PRODUCT, '/bulk-upc', json={'upcs': upcs}) return service_utils.process_response(res, services.OWS_PRODUCT)