VUser::Google::ApiProtocol(3pm) | User Contributed Perl Documentation | VUser::Google::ApiProtocol(3pm) |
VUser::Google::ApiProtocol - Base class for implementation of the Google APIs
This class is not meant to be used directly. Instead use VUser::Google::ApiProtocol::V2_0.
These are the members of the ApiProtocol class. You get and set the values by using the method of the same name. For example:
# Get the domain from the ApiProtocol object my $domain = $google->domain; # Set the domain $google->domain('myappsdomain.com');
Most of the member can be set when the object is created with "new()".
my $google = VUser::ApiProtocol->new( domain => 'myappsdomain.com' );
Note: VUser::Google::ApiProtocol is not meant to be used directly. Please see the version specific subclasses, such as VUser::Google::ApiProtocol::V2_0, to create a usable object.
Create a new ApiProtocol object. Any read-write member may be set in the call to "new()".
Login to the Google API. "Login()" takes no parameters. Instead, you must set the "domain", "admin", and "password" members, then call "Login()".
"Login()" will use the existing authentication token if it exists and hasn't yet timed out. You may force it to do a full re-authentication by setting "refresh_token" to a true value before calling "Login()".
Returns true if the object thinks that it has already authenticated and the token hasn't timed out and a false value otherwise.
Note: "IsAuthenticated()" only knows if there's an authtoken and if it's still fresh. It may be possible for Google to decide that a token is not valid which "IsAuthenticated()" cannot check.
Sends an API request to Google.
$method is the HTTP method to use, e.g. GET, POST, etc. Note: Many of the API calls use different methods. Double check the API docs to make sure you are using the correct method.
$url is the url to use to make the API call. The URLs are defined in the API docs.
$body is the XML specific action. Again, see the API docs for the specific format for each API call. $body is not needed when the method is GET or DELETE.
Prints $message to STDERR if "debug" is set to a true value.
XML::Simple
Randy Smith <perlstalker@vuser.org>
2021-01-09 | perl v5.32.0 |