This is a wrapper function and utilizes the package EMLaide to send an API request to EDI.

publish_data_edi(
  publish_type,
  edi_number,
  publish_environment,
  path_eml_file = here::here("publish", "eml", paste0(edi_number, ".xml"))
)

Arguments

publish_type

Indicate whether you are publishing an update to an existing package or publishing a new data package. Option are: new, update

edi_number

EDI number of the data package being published. This should match the EDI number in the EML document. If you are updating an existing package the EDI number will be one version greater than the existing package.

publish_environment

Environment where data are being published. Recommended to publish on the staging environment first to review the data package and then publish to production. Option are: staging, production

path_eml_file

Path to the EML .xml file. Defaults to publish/eml/<edi_number>.xml, which is where make_eml_edi() writes its output. Override this argument if your EML file lives elsewhere.

Value

A message describing if the upload was successful or not.

Details

This function assumes that make_eml_edi was used to create an EML metadata document and that the file structure follows the documentation. make_eml_edi().

This function also assumes that the user has an EDI account and credentials are stored in their .Renviron as EDI_USER_ID and EDI_PASSWORD