docs: def do_ams_put(endpoint, path, body, access_token, rformat="json", ds_min_version="3.0;NetFx"):
      '''Do a AMS HTTP PUT request and return JSON.
      Args:
          endpoint (str): Azure Media Services Initial Endpoint.
          path (str): Azure Media Services Endpoint Path.
          body  (str): Azure Media Services Content Body.
          access_token (str): A valid Azure authentication token.
          rformat (str): A required JSON Accept Format.
          ds_min_version (str): A required DS MIN Version.
  
      Returns:
          HTTP response. JSON body.
      '''
      min_ds = dsversion_min
      content_acceptformat = json_acceptformat
      if rformat == "json_only":
          min_ds = ds_min_version
          content_acceptformat = json_only_acceptformat
          headers = {"Content-Type": content_acceptformat,
                     "DataServiceVersion": min_ds,
                     "MaxDataServiceVersion": dsversion_max,
                     "Accept": json_acceptformat,
                     "Accept-Charset" : charset,
                     "Authorization": "Bearer " + access_token,
                     "x-ms-version" : xmsversion}
      response = requests.put(endpoint, data=body, headers=headers, allow_redirects=False)
      # AMS response to the first call can be a redirect,
      # so we handle it here to make it transparent for the caller...
      if response.status_code == 301:
          redirected_url = ''.join([response.headers['location'], path])
          response = requests.put(redirected_url, data=body, headers=headers)
          return response