import requests
import json


def put_item(client, item) -> tuple[int, str]:
    """PUT updated item to FOLIO inventory

    Args:
        client: FolioClient
        item: JSON representation of item as a dictionary

    Returns:
        Tuple of HTTP status code and message if error.
    """

    url = f"{client.okapi_url}/inventory/items/{item['id']}"
    req = requests.put(url, headers=client.okapi_headers, data=json.dumps(item))
    return (req.status_code, req.text)