docs: def add_digital_object(
          self,
          parent_archival_object,
          identifier,
          title=None,
          uri=None,
          location_of_originals=None,
          object_type="text",
          xlink_show="embed",
          xlink_actuate="onLoad",
          restricted=False,
          use_statement="",
          use_conditions=None,
          access_conditions=None,
          size=None,
          format_name=None,
          format_version=None,
          inherit_dates=False,
          inherit_notes=False,
      ):
          """
          Creates a new digital object.
  
          :param string parent_archival_object: The archival object to which the newly-created digital object will be parented.
          :param string identifier: A unique identifier for the digital object, in any format.
          :param string title: The title of the digital object.
          :param string uri: The URI to an instantiation of the digital object.
          :param string location_of_originals: If provided, will create an `originalsloc` (location of originals) note in the digital object using this text.
          :param string object_type: The type of the digital object.
              Defaults to "text".
          :param string xlink_show: Controls how the file will be displayed.
              For supported values, see: http://www.w3.org/TR/xlink/#link-behaviors
          :param string xlink_actuate:
          :param string use_statement:
          :param string use_conditions: A paragraph of human-readable text to specify conditions of use for the digital object.
              If provided, creates a "conditions governing use" note in the digital object.
          :param string access_conditions: A paragraph of human-readable text to specify conditions of use for the digital object.
              If provided, creates a "conditions governing access" note in the digital object.
          :param int size: Size in bytes of the digital object
          :param str format_name: Name of the digital object's format
          :param str format_version: Name of the digital object's format version
          :param bool inherit_dates: Inherit dates
          :param bool inherit_notes: Inherit parent notes
          """
          parent_record = self.get_record(parent_archival_object)
          repository = parent_record["repository"]["ref"]
          language = parent_record.get("language", "")
  
          if not title:
              filename = os.path.basename(uri) if uri is not None else "Untitled"
              title = parent_record.get("display_string", filename)
  
          new_object = {
              "title": title,
              "digital_object_id": identifier,
              "digital_object_type": object_type,
              "language": language,
              "notes": [],
              "restrictions": restricted,
              "subjects": parent_record["subjects"],
              "linked_agents": parent_record["linked_agents"],
          }
  
          if inherit_dates:
              new_object["dates"] = parent_record["dates"]
  
          if location_of_originals is not None:
              new_object["notes"].append(
                  {
                      "jsonmodel_type": "note_digital_object",
                      "type": "originalsloc",
                      "content": [location_of_originals],
                      "publish": False,
                  }
              )
  
          if uri is not None:
              new_object["file_versions"] = [
                  {
                      "file_uri": uri,
                      "use_statement": use_statement,
                      "xlink_show_attribute": xlink_show,
                      "xlink_actuate_attribute": xlink_actuate,
                  }
              ]
  
          note_digital_object_type = [
              "summary",
              "bioghist",
              "accessrestrict",
              "userestrict",
              "custodhist",
              "dimensions",
              "edition",
              "extent",
              "altformavail",
              "originalsloc",
              "note",
              "acqinfo",
              "inscription",
              "langmaterial",
              "legalstatus",
              "physdesc",
              "prefercite",
              "processinfo",
              "relatedmaterial",
          ]
  
          if inherit_notes:
              for pnote in parent_record["notes"]:
                  if pnote["type"] in note_digital_object_type:
                      dnote = pnote["type"]
                  else:
                      dnote = "note"
                  if "subnotes" in pnote:
                      content = []
                      for subnote in pnote["subnotes"]:
                          if "content" in subnote:
                              content.append(subnote["content"])
                          else:
                              LOGGER.info(
                                  "No content field in %s, skipping adding to child digital object.",
                                  subnote,
                              )
                  else:
                      content = pnote.get("content", "")
  
                  new_object["notes"].append(
                      {
                          "jsonmodel_type": "note_digital_object",
                          "type": dnote,
                          "label": pnote.get("label", ""),
                          "content": content,
                          "publish": pnote["publish"],
                      }
                  )
  
          if use_conditions:
              new_object["notes"].append(
                  {
                      "jsonmodel_type": "note_digital_object",
                      "type": "userestrict",
                      "content": [use_conditions],
                      "publish": True,
                  }
              )
          if access_conditions:
              new_object["notes"].append(
                  {
                      "jsonmodel_type": "note_digital_object",
                      "type": "accessrestrict",
                      "content": [access_conditions],
                      "publish": True,
                  }
              )
          if restricted:
              new_object["file_versions"][0]["publish"] = False
              new_object["publish"] = False
  
          if size:
              new_object["file_versions"][0]["file_size_bytes"] = size
          if format_name:
              new_object["file_versions"][0]["file_format_name"] = format_name
          if format_version:
              new_object["file_versions"][0]["file_format_version"] = format_version
  
          new_object_uri = self._post(
              repository + "/digital_objects", data=json.dumps(new_object)
          ).json()["uri"]
  
          # Now we need to update the parent object with a link to this instance
          parent_record["instances"].append(
              {
                  "instance_type": "digital_object",
                  "digital_object": {"ref": new_object_uri},
              }
          )
          self._post(parent_archival_object, data=json.dumps(parent_record))
  
          new_object["id"] = new_object_uri
          return new_object