Created
April 23, 2022 15:10
-
-
Save isaacharrisholt/bbb063d339a2e799724acf9432fc84a5 to your computer and use it in GitHub Desktop.
This file contains 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
def get_connections_for_workspace(workspace_id: str) -> List[str]: | |
response = requests.post( | |
f'{API_ROOT}/connections/list', | |
json={'workspaceId': workspace_id}, | |
) | |
response.raise_for_status() | |
return [ | |
connection['connectionId'] | |
for connection in response.json()['connections'] | |
if connection['status'] == 'active' # So we can still disable connections in the UI | |
] | |
def trigger_connection_sync(connection_id: str) -> dict: | |
response = requests.post( | |
f'{API_ROOT}/connections/sync', | |
json={'connectionId': connection_id}, | |
) | |
response.raise_for_status() | |
return response.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment