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

API V4 Support #137

Open
tpitale opened this issue Sep 30, 2019 · 17 comments · May be fixed by #141
Open

API V4 Support #137

tpitale opened this issue Sep 30, 2019 · 17 comments · May be fixed by #141
Assignees

Comments

@tpitale
Copy link
Owner

tpitale commented Sep 30, 2019

https://developers.google.com/analytics/devguides/reporting/core/v4/migration

@tpitale tpitale self-assigned this Sep 30, 2019
@luctus
Copy link

luctus commented Feb 18, 2020

Hi @tpitale I wonder if this issue is related to something new I just found: I can't see these new "kind" of web profiles called "App + Web" when calling the web_profiles method.

Thanks in advance!

@tpitale
Copy link
Owner Author

tpitale commented Feb 18, 2020

Could you share the docs for this new kind of profile? It may be V4-only. But I’d be surprised. Either way I reallly need to do this ticket. 😆

@luctus
Copy link

luctus commented Feb 21, 2020

Hi @tpitale! I'm not able to find any related documentation. I'm doing a fork now and will give it a try for the version upgrade.

@luctus
Copy link

luctus commented Feb 21, 2020

wow, the change is massive! lol

@tpitale
Copy link
Owner Author

tpitale commented Feb 21, 2020

Yeah, it isn't a trivial change between V3 and V4 … but I think we can keep the code the same in most legato, and just change the adapter that sends the request to the API. I think that will work.

@tpitale
Copy link
Owner Author

tpitale commented Feb 21, 2020

It's basically … instead of making it query params to one endpoint, it's a POST to another endpoint with a big body for the request.

So, need an adapter to handle converting our structures into either query params or the body. And then a change in the endpoint depending on some config.

@luctus
Copy link

luctus commented Feb 21, 2020

Yes, the change should be done mainly here. right?

Do you want to keep the response object with the same format that you have today?

By the way, the upgrade is only in the Reporting API, not in the Management API, so my initial "App + Web" issue shouldn't be solved by upgrading the Reporting API :(

@tpitale
Copy link
Owner Author

tpitale commented Feb 22, 2020

So, there's some work here: https://github.com/tpitale/legato/blob/master/lib/legato/request.rb#L22 to handle the new endpoint. We'll need a path to switch on.

Changes in the Response

It might be best to move the current Request and Response into a new module like V3::Response and V3::Request so we can then make V4::Request and V4::Response or something like that.

Then, instead of query.to_query_string and this: https://github.com/tpitale/legato/blob/master/lib/legato/request.rb#L37 we'd probably want a new class to take a query and output the query as the request body format.

The User could have some switch on like api_version or something where it defaults to 3, and 4 is an option.

And then based on that we would look up the Request/Response here https://github.com/tpitale/legato/blob/master/lib/legato/user.rb#L14.

And all of that while updating the management API sections to use the V3::Request/response.

@adamjung
Copy link

Hey y'all,

I was wondering how this was moving along and if y'all needed any help! Would definitely be down to help push the api-v4 along if possible.

🙏

@tpitale
Copy link
Owner Author

tpitale commented Mar 24, 2020

Started working on this, but now I have a 9-day-old baby so kinda on pause. Sorry!

@bborn
Copy link

bborn commented Apr 27, 2022

Curious if there are any updates here? I'd love to keep using Legato for V4 if it's supported. If not, what are other people using instead?

@tpitale
Copy link
Owner Author

tpitale commented Apr 27, 2022

I haven't received any PRs for the work. You're welcome to submit one @bborn.

@bborn
Copy link

bborn commented Apr 27, 2022

@tpitale ok, I'd love to help out. Is this still the best approach?

@tpitale
Copy link
Owner Author

tpitale commented Apr 27, 2022

The last time I looked, yeah. Legato hasn't changed much, but I haven't looked at the Google api since that comment.

@tpitale
Copy link
Owner Author

tpitale commented Apr 27, 2022

I've got some time today to work on this, too. Give me through this weekend @bborn?

@bborn
Copy link

bborn commented Apr 27, 2022

@tpitale happy to help out as much as possible! I just don't know the Legato internals all that well 😄

@tpitale
Copy link
Owner Author

tpitale commented Apr 27, 2022

Starting with the changes to move all the existing functionality to a V3 location to make space for a V4.

@tpitale tpitale linked a pull request Apr 28, 2022 that will close this issue
11 tasks
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

Successfully merging a pull request may close this issue.

4 participants