Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Gmail ? #18

Open
pscott-au opened this issue Oct 4, 2018 · 9 comments
Open

How to use Gmail ? #18

pscott-au opened this issue Oct 4, 2018 · 9 comments

Comments

@pscott-au
Copy link

I am able to access the top level API exposed methods such as

print Dumper $gapi_agent->Gmail->Users->getProfile( { userId => 'me' } )->json if ( );

But I am unable to work out how to use any API method that is more deeply described such as Messages::list etc - are these supposed to work or do we need to access the $gapi_agent->api_query lower level method directly for essentially all useful usage?

@sdondley
Copy link
Owner

sdondley commented Oct 4, 2018

Yeah, use the api_query method. I was fiddling about with all this about a month ago and I was able to pull off batch calls and other stuff with it. My memory is a bit fuzzy and the code is a giant hack job but it worked. I'll post it to a github repo so you can look at it. I have to check to make sure no credentials are in there before I do that.

@sdondley
Copy link
Owner

sdondley commented Oct 4, 2018

OK, I shared a repo with you. It has a module I was using to screw around with Moo::Google. Not meant for release. Look in the "hacked_moose_modules" directory. You'll need that module to get the code in my modules to work properly.

I don't know if I left the code in a working state or not. You may need to fuss with it a bit.

@pscott-au
Copy link
Author

pscott-au commented Oct 4, 2018 via email

@sdondley
Copy link
Owner

sdondley commented Oct 4, 2018

Right. Moo::Google doesn't work with all API calls. You have to use api_query.

@pscott-au
Copy link
Author

pscott-au commented Oct 4, 2018 via email

@sdondley
Copy link
Owner

sdondley commented Oct 4, 2018

That's what I was planning on doing, yes. I needed to learn how the api_query worked though. So I did some experimenting with it. I did write a crude function to convert an api call that didn't work into one that did.

@pscott-au
Copy link
Author

pscott-au commented Oct 4, 2018 via email

@sdondley
Copy link
Owner

sdondley commented Oct 4, 2018

Look in the API.pm module in my repo, the "get" method. I have to retrace what I did but it basically enables you to do a get api call with a resource, which you can't do with Moo::Google.

@sdondley
Copy link
Owner

sdondley commented Oct 4, 2018

That module also has a "batch" function which was a real bear to figure out. Had to do a lot of hacking to the Client.pm module to get that working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants