generate_payload: Generate payload

Description Usage Arguments Details Value Examples

View source: R/payload.R

Description

This function turns a mapped data frame or data.table to a payload ready for upload.

Usage

1
2
3
4
5
6
generate_payload(
  dt,
  program_id = "program_id",
  status = "COMPLETED",
  storedBy = "old / archive import"
)

Arguments

dt

A mapped data.table or data frame to transform.

program_id

The ID of the event program.

status

The status of events. By default, events are marked as completed.

storedBy

A reference of the imports. If its an historical upload it better to lebale them as "old / archive import".

Details

generate_payload is typically used in a map or apply function but you can also directly supply a mapped data.table or data frame.

Value

A transformed data.frame.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# transform a single dt to a payload
generate_payload(dt, program_id = "idgtsybkji2")

# transform a list of data frames to a payload
purrr::map(dt, generate_payload)


## End(Not run)

INyabuto/a360importer documentation built on Jan. 9, 2020, 4:25 p.m.