NAME
Nuvol::Config - Config for Nuvol connectors
SYNOPSIS
use Nuvol;
my $connector = Nuvol::connect($configfile);
my $config = $connector->config;
$config->access_token;
$config->app_id;
$config->app_secret;
$config->digest;
$config->file;
$config->redirect_uri;
$config->refresh_token;
$config->save;
$config->scope;
$config->service;
$config->validto;
DESCRIPTION
Nuvol::Config is a file-based container for Nuvol connector configurations.
CONSTRUCTOR
via Nuvol
use Nuvol;
$connector = Nuvol::connect($configfile);
$config = $connector->config;
In daily use a Nuvol::Config is created with "config" in Nuvol::Connector.
new
use Nuvol::Config;
%params = (
app_id => $app_id,
app_secret => $app_secret,
redirect_uri => $redirect_uri,
scope => $scope,
service => $service,
);
$config = Nuvol::Config->new($configfile, \%params);
Internally the constructor is called. If the file doesn't exist the above parameters are required.
METHODS
access_token
$access_token = $config->access_token;
$config = $config->access_token($new_access_token);
Getter and setter for the access token.
app_id
$app_id = $config->app_id;
Getter for the app id.
app_secret
$app_secret = $config->app_secret;
Getter for the app secret.
digest
$digest = $config->digest;
Getter for the digest of the "file" at the time of the last access.
file
$file = $config->file;
Getter for the config file. Returns a Mojo::File with Mojo::File::Role::Digest.
redirect_uri
$redirect_uri = $config->redirect_uri;
Getter for the redirect URI.
refresh_token
$refresh_token = $config->refresh_token;
$config = $config->refresh_token($new_refresh_token);
Getter and setter for the refresh token.
response_type
$response_type = $config->response_type;
Getter for the authentication response type.
save
$config = $config->save;
Saves the current values to the config file.
scope
$scope = $config->scope;
$config = $config->scope($new_scope);
Getter and setter for the scope.
service
$service = $config->service;
Getter for the service of the connection.
validto
$validto = $config->validto;
$config = $config->validto($new_validto);
Getter and setter for the validto time.