csgillespie / rtypeform

@@ -1,8 +1,19 @@
Loading
1 +
#' Get Authorziation
2 +
#'
3 +
#' A function to get authorization
4 +
#' @param api An authentication key
5 +
#' @export
1 6
get_authorization = function(api) {
2 7
  api = get_api(api)
3 8
  httr::add_headers(authorization = glue("bearer {api}"))
4 9
}
5 10
11 +
#' Check api response
12 +
#'
13 +
#' A function that checks the api response
14 +
#' @param resp A response
15 +
#' @param content The content
16 +
#' @export
6 17
#' @importFrom httr status_code
7 18
check_api_response = function(resp, content) {
8 19
  status_code = httr::status_code(resp)
@@ -12,6 +23,13 @@
Loading
12 23
  stop(msg, call. = FALSE)
13 24
}
14 25
26 +
#' Get response
27 +
#'
28 +
#' A function that allows you to get a response from the
29 +
#' server.
30 +
#' @param api An authentication key
31 +
#' @param url The URL of the site
32 +
#' @export
15 33
#' @importFrom httr GET user_agent content add_headers
16 34
get_response = function(api, url) {
17 35
  authorization = get_authorization(api)
@@ -39,7 +57,6 @@
Loading
39 57
  check_api_response(resp, content)
40 58
}
41 59
42 -
43 60
#' @importFrom httr DELETE
44 61
delete_response = function(api, url) {
45 62
  authorization = get_authorization(api)
@@ -54,6 +71,15 @@
Loading
54 71
  check_api_response(resp, content)
55 72
}
56 73
74 +
#' Post response
75 +
#'
76 +
#' A function that allows you to post an update to the
77 +
#' server
78 +
#' @param api An authentication key
79 +
#' @param url The URL of the site
80 +
#' @param body The infrormation sent out to the server. e.g. the title
81 +
#' @param ... Other arguments
82 +
#' @export
57 83
#' @importFrom httr POST
58 84
post_response = function(api, url, body = NULL, ...) {
59 85
  authorization = get_authorization(api)
Files Coverage
R 2.34%
Project Totals (15 files) 2.34%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading