Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Get submissions for a form endpoint #94

Open
9 tasks
maelle opened this issue Jan 20, 2020 · 0 comments
Open
9 tasks

Add support for Get submissions for a form endpoint #94

maelle opened this issue Jan 20, 2020 · 0 comments

Comments

@maelle
Copy link
Contributor

maelle commented Jan 20, 2020

Get submissions for a form

  • Update master and create a new git branch
  • Create script (use_r('get_submissions_for_a_form') + scaffold below)
  • devtools::load_all() for trying
  • Add/update templates under man-roxygen/
  • devtools::document() for Rd and NAMESPACE updating
  • Add entry to pkgdown config
  • Add test (use_test('get_submissions_for_a_form'))
  • Add NEWS entry
  • Open PR referencing this issue

R script template

#' WIP - Get submissions for a form (raw and tidy)
#'
#' @description Get the submissions for the specified form. This will include the fields in the submissions, the time of the form submission, and the page URL that the form was submitted on. Submissions will be returned in reverse-chronological order. from the [Get submissions for a form endpoint](https://developers.hubspot.com/docs/methods/forms/get-submissions-for-a-form).
#' @details Required scope(s) for the OAuth token: forms.
#' @template token_path
#' @template apikey
#'
#' @return A list (`hs_get_submissions_for_a_form_raw()`)
#' @rdname get-submissions-for-a-form
#' @export
#' @examples
#' \donttest{
#' hs_get_submissions_for_a_form_raw()
#' }
hs_get_submissions_for_a_form_raw <- function() {
  path <- "/form-integrations/v1/submissions/forms/:form_guid"
}
# tidiers -----------------------------------------------------------------
#' @rdname get-submissions-for-a-form
#' @template get_submissions_for_a_form
#' @template view
#' @return A tibble with associated entities (`hs_get_submissions_for_a_form_tidy()`)
#' @export
hs_get_submissions_for_a_form_tidy <- function(get_submissions_for_a_form = hs_get_submissions_for_a_form_raw(),
                                              view = "lalalala") {
  # view <- match.arg(view, c('lalalala'))

  # switch(view,
  #       'lalalala' = blabla)
}

test template

vcr::use_cassette("hs_get_submissions_for_a_form_raw", {

  test_that("hs_get_submissions_for_a_form_raw works", {

    expect_is(hs_get_submissions_for_a_form_raw(), "list")

  })

})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant