request_generate: Build a request for the Google Calendar API

Description Usage Arguments Value See Also Examples

View source: R/generate_request.R

Description

Build a request, using knowledge of the Calendar v3 API from its Discovery Document. Most users should, instead, use higher-level wrappers that facilitate common tasks, such as reading calendar lists or calendar entries. The functions here are intended for internal use and for programming around the Calendar API.

request_generate() lets you provide the bare minimum of input. It takes a nickname for an endpoint and:

Usage

1
2
3
4
5
request_generate(
  endpoint = character(),
  params = list(),
  token = calendar_token()
)

Arguments

endpoint

Character. Nickname for one of the selected Calendar v3 API endpoints built into gcalendr. Learn more in calendar_endpoints().

params

Named list. Parameters destined for endpoint URL substitution, the query, or the body.

token

Calendar token.

Value

list()
Components are method, path, query, body, token, and url, suitable as input for request_make().

See Also

gargle::request_develop(), gargle::request_build()

Other low-level API functions: calendar_token()

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
req <- request_generate(
  "drive.files.get",
  list(fileId = "abc"),
  token = calendar_token()
)
req

## End(Not run)

andrie/gcalendr documentation built on March 8, 2020, 2:36 a.m.