begin adding doc strings to endpoint helper
This commit is contained in:
+74
-1
@@ -3,28 +3,101 @@ import uuid
|
|||||||
# connectivity endpoints
|
# connectivity endpoints
|
||||||
|
|
||||||
def GetPingEndpoint(baseUrl: str):
|
def GetPingEndpoint(baseUrl: str):
|
||||||
|
"""
|
||||||
|
Returns the ping endpoint.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
baseUrl (`str`): The base url for the api.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The ping endpoint as a string.
|
||||||
|
"""
|
||||||
|
|
||||||
return f'{baseUrl}/Ping'
|
return f'{baseUrl}/Ping'
|
||||||
|
|
||||||
# app endpoints
|
# app endpoints
|
||||||
|
|
||||||
def GetAppsEndpoint(baseUrl: str):
|
def GetAppsEndpoint(baseUrl: str):
|
||||||
|
"""
|
||||||
|
Returns the get apps endpoint.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
baseUrl (`str`): The base url for the api.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The get apps endpoint as a string.
|
||||||
|
"""
|
||||||
|
|
||||||
return f'{baseUrl}/Apps'
|
return f'{baseUrl}/Apps'
|
||||||
|
|
||||||
def GetAppByIdEndpoint(baseUrl: str, appId: int):
|
def GetAppByIdEndpoint(baseUrl: str, appId: int):
|
||||||
|
"""
|
||||||
|
Returns the get app by id endpoint.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
baseUrl (`str`): The base url for the api.
|
||||||
|
appId (`int`): The id of the app being requested.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The get app by id endpoint as a string.
|
||||||
|
"""
|
||||||
|
|
||||||
return f'{baseUrl}/Apps/id/{appId}'
|
return f'{baseUrl}/Apps/id/{appId}'
|
||||||
|
|
||||||
def GetAppByIdsEndpoint(baseUrl: str):
|
def GetAppsByIdsEndpoint(baseUrl: str):
|
||||||
|
"""
|
||||||
|
Returns the get apps by ids endpoint.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
baseUrl (`str`): The base url for the api.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The get apps by ids endpoint as a string.
|
||||||
|
"""
|
||||||
|
|
||||||
return f'{baseUrl}/Apps/batch-get'
|
return f'{baseUrl}/Apps/batch-get'
|
||||||
|
|
||||||
# field endpoints
|
# field endpoints
|
||||||
|
|
||||||
def GetFieldByIdEndpoint(baseUrl: str, fieldId: int):
|
def GetFieldByIdEndpoint(baseUrl: str, fieldId: int):
|
||||||
|
"""
|
||||||
|
Returns the get field by id endpoint.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
baseUrl (`str`): The base url for the api.
|
||||||
|
fieldId (`int`): The id of the field being requested.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The get field by id endpoint as a string.
|
||||||
|
"""
|
||||||
|
|
||||||
return f'{baseUrl}/Fields/id/{fieldId}'
|
return f'{baseUrl}/Fields/id/{fieldId}'
|
||||||
|
|
||||||
def GetFieldsByIdsEndpoint(baseUrl: str):
|
def GetFieldsByIdsEndpoint(baseUrl: str):
|
||||||
|
"""
|
||||||
|
Returns the get fields by ids endpoint.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
baseUrl (`str`): The base url for the api.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The get fields by ids endpoint as a string.
|
||||||
|
"""
|
||||||
|
|
||||||
return f'{baseUrl}/Fields/batch-get'
|
return f'{baseUrl}/Fields/batch-get'
|
||||||
|
|
||||||
def GetFieldsByAppIdEndpoint(baseUrl: str, appId: int):
|
def GetFieldsByAppIdEndpoint(baseUrl: str, appId: int):
|
||||||
|
"""
|
||||||
|
Returns the get fields by app id endpoint.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
baseUrl (`str`): The base url for the api.
|
||||||
|
appId (`int`): The id of the app whose fields are being requested.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The get fields by app id endpoint as a string.
|
||||||
|
"""
|
||||||
|
|
||||||
return f'{baseUrl}/Fields/appId/{appId}'
|
return f'{baseUrl}/Fields/appId/{appId}'
|
||||||
|
|
||||||
# file endpoints
|
# file endpoints
|
||||||
|
|||||||
+1
-1
@@ -179,7 +179,7 @@ class OnspringClient:
|
|||||||
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
endpoint = GetAppByIdsEndpoint(self.baseUrl)
|
endpoint = GetAppsByIdsEndpoint(self.baseUrl)
|
||||||
|
|
||||||
self.headers['Content-Type'] = 'application/json'
|
self.headers['Content-Type'] = 'application/json'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user