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 contacts in a list endpoint #88

Open
9 tasks
maelle opened this issue Jan 20, 2020 · 1 comment
Open
9 tasks

Add support for Get contacts in a list endpoint #88

maelle opened this issue Jan 20, 2020 · 1 comment

Comments

@maelle
Copy link
Contributor

maelle commented Jan 20, 2020

Get contacts in a list

  • Update master and create a new git branch
  • Create script (use_r('get_contacts_in_a_list') + 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_contacts_in_a_list'))
  • Add NEWS entry
  • Open PR referencing this issue

R script template

#' WIP - Get contacts in a list (raw and tidy)
#'
#' @description For a given portal and a given list, identified by its unique ID, return a list of contacts that are in that list. from the [Get contacts in a list endpoint](https://developers.hubspot.com/docs/methods/lists/get_list_contacts).
#' @details Required scope(s) for the OAuth token: none.
#' @template token_path
#' @template apikey
#'
#' @return A list (`hs_get_contacts_in_a_list_raw()`)
#' @rdname get-contacts-in-a-list
#' @export
#' @examples
#' \donttest{
#' hs_get_contacts_in_a_list_raw()
#' }
hs_get_contacts_in_a_list_raw <- function() {
  path <- " /contacts/v1/lists/:list_id/contacts/all"
}
# tidiers -----------------------------------------------------------------
#' @rdname get-contacts-in-a-list
#' @template get_contacts_in_a_list
#' @template view
#' @return A tibble with associated entities (`hs_get_contacts_in_a_list_tidy()`)
#' @export
hs_get_contacts_in_a_list_tidy <- function(get_contacts_in_a_list = hs_get_contacts_in_a_list_raw(),
                                          view = "lalalala") {
  # view <- match.arg(view, c('lalalala'))

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

test template

vcr::use_cassette("hs_get_contacts_in_a_list_raw", {

  test_that("hs_get_contacts_in_a_list_raw works", {

    expect_is(hs_get_contacts_in_a_list_raw(), "list")

  })

})
@maelle
Copy link
Contributor Author

maelle commented Jan 20, 2020

Here, the automatic naming is not very good, so the functions etc. should be renamed.

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