Gargle-class: OAuth2 token objects specific to Google APIs

Description Super classes Public fields Methods

Description

Gargle2.0 is based on the Token2.0 class provided in httr. The preferred way to create a Gargle2.0 token is through the constructor function gargle2.0_token(). Key differences with Token2.0:

Super classes

httr::Token -> httr::Token2.0 -> Gargle2.0

Public fields

email

Email associated with the token.

package

Name of the package requesting a token. Used in messages.

Methods

Public methods

Inherited methods

Method new()

Create a Gargle2.0 token

Usage
Gargle2.0$new(
  email = gargle_oauth_email(),
  app = gargle_app(),
  package = "gargle",
  credentials = NULL,
  params = list(),
  cache_path = gargle_oauth_cache()
)
Arguments
email

Optional email address. See gargle2.0_token() for full details.

app

An OAuth consumer application.

package

Name of the package requesting a token. Used in messages.

credentials

Exists largely for testing purposes.

params

A list of parameters for httr::init_oauth2.0(). Some we actively use in gargle: scope, use_oob. Most we do not: user_params, type, as_header, use_basic_auth, config_init, client_credentials.

cache_path

Specifies the OAuth token cache. Read more in gargle_oauth_cache().

Returns

A Gargle2.0 token.


Method format()

Format a Gargle2.0 token

Usage
Gargle2.0$format(...)
Arguments
...

Not used.


Method print()

Print a Gargle2.0 token

Usage
Gargle2.0$print(...)
Arguments
...

Not used.


Method hash()

Generate the email-augmented hash of a Gargle2.0 token

Usage
Gargle2.0$hash()

Method cache()

Put a Gargle2.0 token into the cache

Usage
Gargle2.0$cache()

Method load_from_cache()

(Attempt to) get a Gargle2.0 token from the cache

Usage
Gargle2.0$load_from_cache()

Method refresh()

(Attempt to) refresh a Gargle2.0 token

Usage
Gargle2.0$refresh()

Method init_credentials()

Initiate a new Gargle2.0 token

Usage
Gargle2.0$init_credentials()

Method clone()

The objects of this class are cloneable with this method.

Usage
Gargle2.0$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


gargle documentation built on July 2, 2021, 5:07 p.m.