NAME

Net::Google::Storage::Agent - Access the Google Storage JSON API (currently experimental).

VERSION

version v0.1.0

DESCRIPTION

Role-module for Net::Google::Storage, handles the http communication side of things.

Some or all of the following attributes should be passed in as an argument to "new" in Net::Google::Storage

ATTRIBUTES

access_token

An OAuth2 access token used to actually access the resources.

refresh_token

An OAuth2 refresh token used for acquiring a new "access_tokens" - you don't need both a refresh_token and an access_token, but you'll need at least one of them.

client_id

The client ID for the user being authenticated - retrieved from Google's API Console.

Required for refreshing access tokens (ie provide if you are also providing the "refresh_token").

client_secret

Counterpart to the client ID, also retrieved from the API Console.

Again, only required for refreshing access tokens.

access_token_expiry

The time (in seconds since the epoch) at which the access_token will be invalidated. Not required, but if supplied with the "access_token" it will be trusted, and token refresh will be attempted after this time without attempting communication.

METHODS

has_refreshed_access_token

Call without parameters to find whether the "access_token" has been refreshed.

Call with a false value to indicate you know about that refresh, so future calls without any parameters will still be useful.

refresh_access_token

Call (on the Net::Google::Storage object) to refresh the access token. Requires the client_id, the client_secret and the refresh_token to all be set. Updates the access_token, the access_token_expiry and has_refreshed_access_token will start returning true.

AUTHOR

Glenn Fowler <cebjyre@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Glenn Fowler.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.