Skip to content

Commit

Permalink
Merge pull request #192 from lumapps/feat/use_only_one_discovery_url
Browse files Browse the repository at this point in the history
chore(client): use 1 discovery url for lumapps api
  • Loading branch information
jssevestre committed Dec 5, 2023
2 parents c40e47f + ffebecb commit 3204626
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lumapps/api/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,18 @@ def __init__(
api_ver = api_info["version"]
prefix = "" if api_name in GOOGLE_APIS else "/_ah/api"
self._api_url = f"{prefix}/{api_name}/{api_ver}"
self._discovery_url = (
f"{self.base_url}{prefix}/discovery/v1/apis/{api_name}/{api_ver}/rest"
)
print(api_name)
if api_name == LUMAPPS_NAME:
self._discovery_url = (
"https://sites.lumapps.com/_ah/api/"
"discovery/v1/apis/lumsites/v1/rest"
)

else:
self._discovery_url = (
f"{self.base_url}{prefix}/discovery/"
f"v1/apis/{api_name}/{api_ver}/rest"
)
self.token_getter = token_getter
self.user = user
self.token = token
Expand Down

0 comments on commit 3204626

Please sign in to comment.