You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,25 @@
2
2
3
3
- Use the [Github Issues Page](https://github.com/pscott-au/WebService-GoogleAPI-Client/issues)
4
4
5
-
#CONTRIBUTING CODE
5
+
## Github Repo Management
6
6
7
7
- Aspiring to [Trunk Based Developent](https://paulhammant.com/2013/04/05/what-is-trunk-based-development/)
8
+
- Relase branches are created when package is published to CPAN ( starting V1.12 )
9
+
10
+
11
+
# CONTRIBUTING CODE
12
+
8
13
- Use perlcritic and perltidy if my bracer style is offensive
9
14
- This is my first module using dzilla to package a module - I'm not completely sold on it and may be using it incorrectly - advice on improving usage welcome
10
15
- There remain a few architectural bad smells from the original source code this was based on - don't assume that the class structure is sane
11
16
- Pull reqeusts preferred but whatever works for you I will try to work with
12
17
13
18
# HELP WANTED
14
19
20
+
- Seek reviews from http://prepan.org/module.submit and similar
15
21
- refactor to improve test coverage
16
22
- clean up the test structure
23
+
- survey other Google Perl modules
17
24
- explore handling of batch requests
18
25
- API worked examples with help functions
19
26
- ability to examine CHI cache and introspect on Client instance metrics ( number of HTTP calls, cache size, TTL data sent/received etc )
@@ -11,16 +11,20 @@ WebService::GoogleAPI::Client - Perl Google API Services OAUTH Client.
11
11
12
12
# VERSION
13
13
14
-
version 0.10
14
+
version 0.12
15
15
16
16
# SYNOPSIS
17
17
18
-
Provides client access to All [Google API V.1](https://developers.google.com/discovery/v1)Services using a user-agent that handles OAUTH2 authentication and access control and provides helpers to exploit locally cached API Discovery specifications.
18
+
Provides client access to [Google API V.1](https://developers.google.com/discovery/v1)Service End-Points using a user-agent that handles OAUTH2 authentication and access control and provides helpers to cache API Discovery specifications.
19
19
20
20
The guiding principal is to minimise the conceptual load when using the Client agent for users who want to make calls directly, but also make available functions to help explore unfamiliar API endpoints by offering optional validation etc against the latest published Google API Discovery specifications.
21
21
22
22
23
-
NB: To create or modify an authorization configuration file with scope and user tokens in current folder run _goauth_ CLI tool to interactively create the JSON configuration and launch a local HTTP server to acquire authenticated access permissions with a Google email account. See ````perldoc goauth```` for more detail.
23
+
NB: To create or modify an authorization configuration file with scope and user tokens in current folder run _goauth_ CLI tool to interactively create the JSON configuration and launch a local HTTP server to acquire authenticated access permissions with a Google email account.
## using dotted API Endpoint id to invoke helper validation and default value interpolations etc to send email to self
39
48
use Email::Simple; ## RFC2822 formatted messages
@@ -54,7 +63,7 @@ NB: To create or modify an authorization configuration file with scope and user
54
63
);
55
64
56
65
57
-
66
+
## TEXT TO SPEECH EXAMPLE
58
67
my$text_to_speech_request_options = {
59
68
'input'=> {
60
69
'text'=>'Using the Web-Services-Google-Client Perl module, it is now a simple matter to access all of the Google API Resources in a consistent manner.'
@@ -136,16 +145,13 @@ NB: To create or modify an authorization configuration file with scope and user
136
145
The code in this repository uses [Dist::Zilla](http://dzil.org/) Build System to assist package building and creation of Tarball and CPAN distribution. Curiously the [Github Repo](https://github.com/rjbs/dist-zilla/) describes itself as '*scary tools for building CPAN distributions*'
-[Moo::Google](https://metacpan.org/pod/Moo::Google) - The original code base later forked into [WebService::Google](https://metacpan.org/pod/WebService::Google) but is heading in a different path
223
+
-[Moo::Google](https://metacpan.org/pod/Moo::Google) - The original code base later forked into [WebService::Google](https://metacpan.org/pod/WebService::Google) but is heading in a different direction
218
224
-[Google Swagger API https:](https:///github.com/APIs-guru/google-discovery-to-swagger)
my $raw_email_payload = encode_base64( Email::Simple->create( header => [To => $my_email_address,
27
+
From => $my_email_address,
28
+
Subject =>"Test email from '$my_email_address' ",],
29
+
body => "This is the body of email to '$my_email_address'",
30
+
)->as_string
31
+
);
32
+
33
+
$gapi_client->api_query(
34
+
api_endpoint_id => 'gmail.users.messages.send',
35
+
options => { raw => $raw_email_payload },
36
+
);
37
+
38
+
39
+
40
+
my $text_to_speech_request_options = {
41
+
'input' => {
42
+
'text' => 'Using the Web-Services-Google-Client Perl module, it is now a simple matter to access all of the Google API Resources in a consistent manner.'
Copy file name to clipboardExpand all lines: lib/WebService/GoogleAPI/Client/Discovery.pm
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -61,9 +61,7 @@ sub get_api_discovery_for_api_id
61
61
{
62
62
my ( $self, $params ) = @_;
63
63
## TODO: warn if user doesn't have the necessary scope .. no should stil be able to examine
64
-
## TODO: consolidate the http method calls to a single function - ie - discover_all - simplistic quick fix - assume that if no param then endpoint is as per discover_all
65
-
66
-
64
+
## TODO: consolidate the http method calls to a single function - ie - discover_all - simplistic quick fix - assume that if no param then endpoint is as per discover_all
67
65
68
66
$params = { api=>$params } ifref( $params) eq''; ## scalar parameter not hashref - so assume is intended to be $params->{api}
69
67
## trim any resource, method or version details in api id
@@ -178,13 +176,16 @@ sub discover_all
178
176
179
177
if ( my$expires_at = $self->chi->get_expires_at( 'https://www.googleapis.com/discovery/v1/apis' ) && not$force )
180
178
{
181
-
#carp "discovery_data cached data expires in ", scalar($expires_at) - time(), " seconds\n" if ($self->debug > 2);
0 commit comments