create_json_resource: create_json_resource

Description Usage Arguments Value

View source: R/create_json_resource.R

Description

Create the JSON body for updating the given fields or creating a new dataset

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
create_json_resource(
  values = list(title = "Test Resource Title", body = "Test Resource Body",
    field_wbddh_data_class = "Public", field_wbddh_resource_type =
    "Resource Type not specified", field_format = "Format Not Specified", field_link_api
    = "www.google.com", field_ddh_harvest_src = "Finances", field_ddh_harvest_sys_id =
    "8675309"),
  publication_status = "published",
  dataset_nid = "111",
  ddh_fields = ddhconnect::get_fields(),
  lovs = ddhconnect::get_lovs(),
  root_url = dkanr::get_url()
)

Arguments

values

list: list of corresponding values that need to be updated

publication_status

string: status to post the mode, takes values of c("published", "unpublished", "draft")

dataset_nid

string: dataset to attach resource to

ddh_fields

dataframe: table of all the data catalog fields by node type

lovs

dataframe: lookup table of the data catalog tids and values

root_url

string: API root URL

Value

json string


tonyfujs/ddhconnect documentation built on June 3, 2020, 10:33 a.m.