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

Rewrite for APIv3 #5

Merged
merged 8 commits into from
Nov 17, 2017
Merged

Rewrite for APIv3 #5

merged 8 commits into from
Nov 17, 2017

Conversation

ErikBoesen
Copy link
Member

In this pull request, I've rewritten the entire library to be compatible with TBA API v3.

The new library is instantiated differently than the prior version. Furthermore, as specified in #4, the rewrite uses a builder pattern to construct requests before sending them to TBA's API. For example:

tba.New("tokenhere") // Go best practices advocate using New for libraries with one exposed interface
team, err := tba.Team(1418).Simple().Get()
// ...
rankings, err := tba.District("chs", 2017).Rankings().Get()
// etc.

I've ignored concerns about backward compatibility based on the facts that (a) APIv2 will be shuttered on January 1st, 2018, and (b) I am the only current user of this library and am prepared to make changes to my projects.

I've aggressively tested my implementation and I can't find any issues with it. However, since you've been using Go longer than I have, you may see problems with standards conformity or the like. Please point these out if they at all exist and I'll happily fix them.

Lastly, I'd like to humbly request that you transfer this repository to my account. I recognize that you are in college now and are probably very busy; I don't want to waste your time by submitting pull request after pull request as I continue developing this library. Please let me know if this is something you'd be comfortable with.

Implement Event model

Implement Award model

Implement Match model

Implement Match methods

Implement team years request

Implement Medium model

Implement Robot model

Implement Media construction & requests

Implement Robot requests & District models

Implement District model and requests

Implement Profile model and request

Implement Alliance model & requests

Implement DistrictPoints model and requests

Implement Insights requests

Implement OPRs requests

Complete predictions model, add several requests

Implement all remaining models and requests

Some comment cleanup
@ErikBoesen
Copy link
Member Author

Also, it's probably best to squash this into one commit when you merge.

@CarlColglazier
Copy link
Collaborator

This looks really great! I am pleased to see that the builder design patter could be put to good use here.

I would be happy to transfer the repository to you.

@CarlColglazier CarlColglazier merged commit 886e7ba into frc1418:master Nov 17, 2017
@CarlColglazier
Copy link
Collaborator

You will need to delete your fork before I can perform the transfer: https://help.github.com/articles/about-repository-transfers/

@ErikBoesen
Copy link
Member Author

Done. Didn't want to delete until this was merged.

Thanks so much for your help!

@ErikBoesen ErikBoesen mentioned this pull request Nov 18, 2017
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 this pull request may close these issues.

2 participants