def validate_target_version(tgt_vers)
      raise JSS::MissingDataError, "target_version can't be nil" unless tgt_vers

      JSS::Validate.non_empty_string tgt_vers

      unless patch_title(:refresh).versions.key? tgt_vers
        errmsg = "Version '#{tgt_vers}' does not exist for title: #{patch_title_name}."
        raise JSS::NoSuchItemError, errmsg
      end

      return tgt_vers if patch_title.versions_with_packages.key? tgt_vers

      errmsg = "Version '#{tgt_vers}' cannot be used in Patch Policies until a package is assigned to it."
      raise JSS::UnsupportedError, errmsg
    end
def validate_target_version(tgt_vers)
      raise JSS::MissingDataError, "target_version can't be nil" unless tgt_vers

      JSS::Validate.non_empty_string tgt_vers

      unless patch_title(:refresh).versions.key? tgt_vers
        errmsg = "Version '#{tgt_vers}' does not exist for title: #{patch_title_name}."
        raise JSS::NoSuchItemError, errmsg
      end

      return tgt_vers if patch_title.versions_with_packages.key? tgt_vers

      errmsg = "Version '#{tgt_vers}' cannot be used in Patch Policies until a package is assigned to it."
      raise JSS::UnsupportedError, errmsg
    end
raise an exception if a given target version is not valid for this policy
 Otherwise return it