-
Notifications
You must be signed in to change notification settings - Fork 129
added requests session to ApiClient #80
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
Open
seantibor
wants to merge
22
commits into
prschmid:develop
Choose a base branch
from
seantibor:feature/requests-session
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e2766af
added metric component and some tests
seantibor c004f4a
added more tests for metric component
seantibor dbe3219
rollback .gitignore commit
seantibor 5ea04a3
added metric component to client
seantibor 24b865b
corrected client tests for new component
seantibor f5fc052
added requests session to ApiClient
seantibor 513b176
Merge branch 'develop' into feature/metric
seantibor 51ebe86
updated tests to use responses library
seantibor 4628fda
Merge branch 'develop' into feature/requests-session
seantibor 302ae76
added context manager to ApiClient and tests
seantibor 7d35a3f
Merge branch 'develop' of https://github.com/prschmid/zoomus into fea…
seantibor 87a67a0
added session getter, setter property methods
seantibor 97164af
Merge branch 'feature/metric' into develop
seantibor d9f67a8
Merge branch 'develop' of https://github.com/prschmid/zoomus into dev…
seantibor 3a2db45
Merge branch 'develop' into feature/requests-session
seantibor cc8bf43
Merge branch 'develop' of https://github.com/prschmid/zoomus into dev…
8939508
merge develop
6f9b62e
Merge branch 'develop' of https://github.com/prschmid/zoomus into dev…
9f78bfd
Merge branch 'develop' into feature/requests-session
c28e150
updated to black 21.4
3e19118
again and again
d0a4538
ignoring pre-commit hooks
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great start! For the sake of flexibility can we make this a configurable option and have the ability to start a new session. I.e. Let's make the method signature
Then we can do something like
This should then either use the
Sessionorrequestsdepending on what was requested.We'd then also want to add a new method called something like
new_sessionor something like that so that if someone needs a new session for some reason, they could do that without having to reinstantiate theApiClient.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it might even be better if this let the client be used as a context manager, rather than having to explicitly say
use_session. So then, reusing an example from the readme, a user could do something like:This could be implemented by adding basically
And the individual
get/post, etc, optionally call the client if it's present.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better! Great idea!