Moo::Google::Discovery - Methods for working with Google API discovery service
version 0.03
Retrieve the description of a particular version of an API
my $d = Moo::Google::Discovery->new; $d->getRest({ api=> 'calendar', version => 'v3' });
Return result like
$VAR1 = { 'ownerDomain' => 'google.com', 'version' => 'v2.4', 'protocol' => 'rest', 'icons' => 'HASH(0x29760c0)', 'discoveryVersion' => 'v1', 'id' => 'analytics:v2.4', 'parameters' => 'HASH(0x29709c0)', 'basePath' => '/analytics/v2.4/', 'revision' => '20170321', 'description' => 'Views and manages your Google Analytics data.', 'servicePath' => 'analytics/v2.4/', 'title' => 'Google Analytics API', 'kind' => 'discovery#restDescription', 'rootUrl' => 'https://www.googleapis.com/', 'etag' => '"YWOzh2SDasdU84ArJnpYek-OMdg/uF7o_i10s0Ir7WGM7zLi8NwSHXI"', 'ownerName' => 'Google', 'auth' => 'HASH(0x2948880)', 'resources' => 'HASH(0x296b218)', 'batchPath' => 'batch', 'name' => 'analytics', 'documentationLink' => 'https://developers.google.com/analytics/', 'baseUrl' => 'https://www.googleapis.com/analytics/v2.4/' };
Return details about all APIs
Return arrayref of all available API's (services)
{ 'name' => 'youtube', 'versions' => [ 'v3' ] },
Useful when printing list of supported API's in documentation
Return 1 if service is supported by Google API discovery. Otherwise return 0
warn $d->exists('calendar'); # 1 warn $d->exists('someapi'); # 0
Print list of supported APIs in human-readible format (used in description of Google.pm)
Show available versions of particular API $d->availableVersions('calendar'); # ['v3'] $d->availableVersions('youtubeAnalytics'); # ['v1','v1beta1'] Returns arrayref
$d->availableVersions('calendar'); # ['v3'] $d->latestStableVersion('calendar'); # 'v3' $d->availableVersions('tagmanager'); # ['v1','v2'] $d->latestStableVersion('tagmanager'); # ['v2'] $d->availableVersions('storage'); # ['v1','v1beta1', 'v1beta2'] $d->latestStableVersion('storage'); # ['v1']
Return only APIs with multiple versions available
Search in services in "I'm lucky way" Must process case-insensitive way: e.g. Class is called CalendarList but resources is called calendarList in discovery
Download metadata from Google API discovery for particular class method
$discovery->getResourceMeta('Moo::Google::Calendar::CalendarList::delete')
Download metadata from Google API discove for particular resource
$discovery->getResourceMeta('Moo::Google::Calendar::Events')
Return array of methods that are available for particular resource
$discovery->listOfMethods('Moo::Google::Calendar::Events')
Same as getRest method but faster. Uses as cache discovery_full attribute to avoid multimple requests metaForAPI({ api => 'calendar', version => 'v3' });
https://developers.google.com/discovery/v1/reference/
Pavel Serikov <pavelsr@cpan.org>
This software is copyright (c) 2017 by Pavel Serikov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Moo::Google, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Moo::Google
CPAN shell
perl -MCPAN -e shell install Moo::Google
For more information on module installation, please visit the detailed CPAN module installation guide.