r-lib / gmailr

Access the Gmail RESTful API from R.
https://gmailr.r-lib.org
Other
229 stars 56 forks source link

Consider adding gm_user() #114

Closed jennybc closed 5 years ago

jennybc commented 5 years ago

I find a function that reports on the current user (token, really) to be very useful.

Some APIs have a useful user or about endpoint. Drive does, so drive_user() exposes:

https://github.com/tidyverse/googledrive/blob/master/R/drive_user.R

Some APIs do not have a user endpoint. BigQuery does not, so bq_user() falls back to some barebones token inspection from gargle:

https://github.com/r-dbi/bigrquery/blob/306023a57c62bb7fe7c370ffb4f500e3dc6b74c2/R/bq-auth.R#L201-L207