Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
it-bott-integrasjoner
topdesk-client
Commits
92c56ef6
Commit
92c56ef6
authored
Aug 26, 2019
by
Jo Sama
😱
Browse files
Rewrite list_operators()
parent
65d3a82b
Changes
1
Hide whitespace changes
Inline
Side-by-side
topdesk_client/client.py
View file @
92c56ef6
...
...
@@ -3,7 +3,7 @@ import requests
from
urllib.parse
import
urljoin
,
urlparse
from
.model
import
Operator
,
Operators
from
.model
import
Operator
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -18,6 +18,9 @@ class Endpoints:
def
get_operator
(
self
,
identity
):
return
urljoin
(
self
.
_prepend_base_url
(
'/operators/'
),
identity
)
def
get_operators
(
self
):
return
self
.
_prepend_base_url
(
'/operators/'
)
class
TopDeskClient
:
def
__init__
(
self
,
url
,
headers
=
None
,
rewrite_url
=
None
):
...
...
@@ -68,7 +71,8 @@ class TopDeskClient:
return
Operator
.
from_dict
(
self
.
get
(
url
))
def
list_operators
(
self
):
return
Operators
(
self
.
get
(
self
.
urls
.
get_operator
()))
for
x
in
self
.
get
(
self
.
urls
.
get_operators
()):
yield
Operator
.
from_dict
(
x
)
def
get_client
(
config
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment