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

Update oauth_client.py #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pysnow/oauth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ def _legacy_request(self, *args, **kwargs):
"You must set_token() before creating a legacy request with OAuthClient"
)

def resource(self, api_path=None, base_path="/api/now", chunk_size=None):
def resource(self, api_path=None, base_path="/api/now", chunk_size=None, **kwargs):
"""Overrides :meth:`resource` provided by :class:`pysnow.Client` with extras for OAuth

:param api_path: Path to the API to operate on
:param base_path: (optional) Base path override
:param chunk_size: Response stream parser chunk size (in bytes)
:param **kwargs: Pass request.request parameters to the Resource object
:return:
- :class:`Resource` object
:raises:
Expand All @@ -130,7 +131,7 @@ def resource(self, api_path=None, base_path="/api/now", chunk_size=None):

if isinstance(self.token, dict):
self.session = self._get_oauth_session()
return super(OAuthClient, self).resource(api_path, base_path, chunk_size)
return super(OAuthClient, self).resource(api_path, base_path, chunk_size, **kwargs)

raise MissingToken(
"You must set_token() before creating a resource with OAuthClient"
Expand Down