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 all pipelines for a specified object type endpoint #91

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

Comments

@maelle
Copy link
Contributor

maelle commented Jan 20, 2020

Get all pipelines for a specified object type

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

R script template

#' WIP - Get all pipelines for a specified object type (raw and tidy)
#'
#' @description  ,Get all of the pipelines for the specified object type. This currently supports pipelines for deals and tickets. , from the [Get all pipelines for a specified object type endpoint](https://developers.hubspot.com/docs/methods/pipelines/get_pipelines_for_object_type).
#' @details Required scope(s) for the OAuth token: none.
#' @template token_path
#' @template apikey
#' @template  o_auth_access_token_or_api_key ADD TO A TEMPLATE Used to authenticate the request. Please see this page for more details about authentication.
#' @template  object_type ADD TO A TEMPLATE The object type that you want the pipelines for. Must be one of: deals tickets
#' @template  include_inactive ADD TO A TEMPLATE Whether or not to include inactive pipelines. Inactive pipelines and stages cannot be used when creating or updating objects. Must be one of: EXCLUDE_DELETED (default) INCLUDE_DELETED
#' @return A list (`hs_pipelines_for_a_specified_object_type_raw()`)
#' @rdname pipelines-for-a-specified-object-type
#' @export
#' @examples
#' \donttest{
#' hs_pipelines_for_a_specified_object_type_raw(o_auth_access_token_or_api_key, object_type, include_inactive)
#' }
hs_pipelines_for_a_specified_object_type_raw <- function(o_auth_access_token_or_api_key, object_type, include_inactive) {
  path <- "GET /crm-pipelines/v1/pipelines/:object_type"
}
# tidiers -----------------------------------------------------------------
#' @rdname pipelines-for-a-specified-object-type
#' @template pipelines_for_a_specified_object_type
#' @template view
#' @return A tibble with associated entities (`hs_pipelines_for_a_specified_object_type_tidy()`)
#' @export
hs_pipelines_for_a_specified_object_type_tidy <- function(pipelines_for_a_specified_object_type = hs_pipelines_for_a_specified_object_type_raw(),
                                                         view = "lalalala") {
  # view <- match.arg(view, c('lalalala'))

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

test template

vcr::use_cassette("hs_pipelines_for_a_specified_object_type_raw", {

  test_that("hs_pipelines_for_a_specified_object_type_raw works", {

    expect_is(hs_pipelines_for_a_specified_object_type_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