more doc strings
This commit is contained in:
@@ -139,6 +139,18 @@ class GetFileByIdResponse:
|
|||||||
self.file = file
|
self.file = file
|
||||||
|
|
||||||
class SaveFileRequest:
|
class SaveFileRequest:
|
||||||
|
"""
|
||||||
|
An object to represent all the necessary information needed to make a successful 'OnspringClient.SaveFile' request.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
recordId (`int`): The unique id of the record where you want to save the file.
|
||||||
|
fieldId (`int`): The unique id of the field where you want to save the file.
|
||||||
|
fileName (`str`): The name of the file you want to save.
|
||||||
|
filePath (`str`): The path to the file you want to save.
|
||||||
|
contentType (`str`): The content type of the file you want to save.
|
||||||
|
notes (`str`): An option note about the file.
|
||||||
|
notes (`datetime`): An optional date noting when the file was modified.
|
||||||
|
"""
|
||||||
def __init__(self, recordId: int, fieldId: int, fileName: str, filePath: str, contentType: str, notes: str=None, modifiedDate: datetime=None):
|
def __init__(self, recordId: int, fieldId: int, fileName: str, filePath: str, contentType: str, notes: str=None, modifiedDate: datetime=None):
|
||||||
self.recordId = recordId
|
self.recordId = recordId
|
||||||
self.fieldId = fieldId
|
self.fieldId = fieldId
|
||||||
|
|||||||
+108
-1
@@ -45,7 +45,7 @@ class OnspringClient:
|
|||||||
|
|
||||||
def GetApps(self, pagingRequest=PagingRequest(1, 50)):
|
def GetApps(self, pagingRequest=PagingRequest(1, 50)):
|
||||||
"""
|
"""
|
||||||
Gets all accessible apps.
|
Gets all accessible apps for client.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
pagingRequest (`Models.PagingRequest`): Used to set the page number and page size of the request. By default the these will be 1 and 50 respectively.
|
pagingRequest (`Models.PagingRequest`): Used to set the page number and page size of the request. By default the these will be 1 and 50 respectively.
|
||||||
@@ -110,6 +110,15 @@ class OnspringClient:
|
|||||||
raw=response)
|
raw=response)
|
||||||
|
|
||||||
def GetAppById(self, appId: int):
|
def GetAppById(self, appId: int):
|
||||||
|
"""
|
||||||
|
Get an app by it's id.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
appId (`int`): The unique id of the app being requested.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = GetAppByIdEndpoint(self.baseUrl, appId)
|
endpoint = GetAppByIdEndpoint(self.baseUrl, appId)
|
||||||
|
|
||||||
@@ -160,6 +169,15 @@ class OnspringClient:
|
|||||||
raw=response)
|
raw=response)
|
||||||
|
|
||||||
def GetAppsByIds(self, appIds: list):
|
def GetAppsByIds(self, appIds: list):
|
||||||
|
"""
|
||||||
|
Get a set of apps by their ids.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
appIds (`list[int]`): A list of unique ids for the apps being requested.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = GetAppByIdsEndpoint(self.baseUrl)
|
endpoint = GetAppByIdsEndpoint(self.baseUrl)
|
||||||
|
|
||||||
@@ -226,6 +244,15 @@ class OnspringClient:
|
|||||||
# field methods
|
# field methods
|
||||||
|
|
||||||
def GetFieldById(self, fieldId: int):
|
def GetFieldById(self, fieldId: int):
|
||||||
|
"""
|
||||||
|
Get a field by it's id.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
fieldId (`int`): The unique id of the field being requested.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = GetFieldByIdEndpoint(self.baseUrl, fieldId)
|
endpoint = GetFieldByIdEndpoint(self.baseUrl, fieldId)
|
||||||
|
|
||||||
@@ -303,6 +330,15 @@ class OnspringClient:
|
|||||||
raw=response)
|
raw=response)
|
||||||
|
|
||||||
def GetFieldsByIds(self, fieldIds: list):
|
def GetFieldsByIds(self, fieldIds: list):
|
||||||
|
"""
|
||||||
|
Get a set of fields by their ids.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
fieldIds (`list[int]`): A list of unique ids for the fields being requested.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = GetFieldsByIdsEndpoint(self.baseUrl)
|
endpoint = GetFieldsByIdsEndpoint(self.baseUrl)
|
||||||
|
|
||||||
@@ -378,6 +414,16 @@ class OnspringClient:
|
|||||||
raw=response)
|
raw=response)
|
||||||
|
|
||||||
def GetFieldsByAppId(self, appId: int, pagingRequest=PagingRequest(1, 50)):
|
def GetFieldsByAppId(self, appId: int, pagingRequest=PagingRequest(1, 50)):
|
||||||
|
"""
|
||||||
|
Get all fields for an app.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
appId (`int`): The unique id of the app whose fields are being requested.
|
||||||
|
pagingRequest (`Models.PagingRequest`): Used to set the page number and page size of the request. By default the these will be 1 and 50 respectively.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = GetFieldsByAppIdEndpoint(self.baseUrl, appId)
|
endpoint = GetFieldsByAppIdEndpoint(self.baseUrl, appId)
|
||||||
|
|
||||||
@@ -443,6 +489,17 @@ class OnspringClient:
|
|||||||
# file methods
|
# file methods
|
||||||
|
|
||||||
def GetFileInfoById(self, recordId: int, fieldId: int, fileId: int):
|
def GetFileInfoById(self, recordId: int, fieldId: int, fileId: int):
|
||||||
|
"""
|
||||||
|
Get the metadata information for a file.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
recordId (`int`): The unique id of the record that contains the file you want to retrieve.
|
||||||
|
fieldId (`int`): The unique id of the field that contains the file you want to retrieve.
|
||||||
|
fileId (`int`): The unique id of the file whose metadata you want to retrieve.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = GetFileInfoByIdEndpoint(
|
endpoint = GetFileInfoByIdEndpoint(
|
||||||
self.baseUrl,
|
self.baseUrl,
|
||||||
@@ -511,6 +568,17 @@ class OnspringClient:
|
|||||||
raw=response)
|
raw=response)
|
||||||
|
|
||||||
def DeleteFileById(self, recordId: int, fieldId: int, fileId: int):
|
def DeleteFileById(self, recordId: int, fieldId: int, fileId: int):
|
||||||
|
"""
|
||||||
|
Delete a file by its id.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
recordId (`int`): The unique id of the record that contains the file you want to delete.
|
||||||
|
fieldId (`int`): The unique id of the field that contains the file you want to delete.
|
||||||
|
fileId (`int`): The unique id of the file you want to delete.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = DeleteFileByIdEndpoint(
|
endpoint = DeleteFileByIdEndpoint(
|
||||||
self.baseUrl,
|
self.baseUrl,
|
||||||
@@ -565,6 +633,17 @@ class OnspringClient:
|
|||||||
raw=response)
|
raw=response)
|
||||||
|
|
||||||
def GetFileById(self, recordId: int, fieldId: int, fileId: int):
|
def GetFileById(self, recordId: int, fieldId: int, fileId: int):
|
||||||
|
"""
|
||||||
|
Get a file by its id.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
recordId (`int`): The unique id of the record that contains the file you want to retrieve.
|
||||||
|
fieldId (`int`): The unique id of the field that contains the file you want to retrieve.
|
||||||
|
fileId (`int`): The unique id of the file you want to retrieve.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = GetFileByIdEndpoint(
|
endpoint = GetFileByIdEndpoint(
|
||||||
self.baseUrl,
|
self.baseUrl,
|
||||||
@@ -633,6 +712,15 @@ class OnspringClient:
|
|||||||
raw=response)
|
raw=response)
|
||||||
|
|
||||||
def SaveFile(self, saveFileRequest: SaveFileRequest):
|
def SaveFile(self, saveFileRequest: SaveFileRequest):
|
||||||
|
"""
|
||||||
|
Delete a file by its id.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
saveFileRequest (`Model.SaveFileRequest`): An object representing all the necessary information to make a successful request.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = SaveFileEndpoint(self.baseUrl)
|
endpoint = SaveFileEndpoint(self.baseUrl)
|
||||||
|
|
||||||
@@ -698,6 +786,15 @@ class OnspringClient:
|
|||||||
# list methods
|
# list methods
|
||||||
|
|
||||||
def AddOrUpdateListItem(self, listItemRequest: ListItemRequest):
|
def AddOrUpdateListItem(self, listItemRequest: ListItemRequest):
|
||||||
|
"""
|
||||||
|
Add or update a list value by its id.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
listItemRequest (`Model.ListItemRequest`): An object representing all the necessary information to make a successful request.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = AddOrUpdateListItemEndpoint(self.baseUrl, listItemRequest.listId)
|
endpoint = AddOrUpdateListItemEndpoint(self.baseUrl, listItemRequest.listId)
|
||||||
|
|
||||||
@@ -758,6 +855,16 @@ class OnspringClient:
|
|||||||
raw=response)
|
raw=response)
|
||||||
|
|
||||||
def DeleteListItem(self, listId: int, itemId: uuid):
|
def DeleteListItem(self, listId: int, itemId: uuid):
|
||||||
|
"""
|
||||||
|
Delete a list value by its id and it's parent list id.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
listId (`int`): The unique id of the list values parent list.
|
||||||
|
itemId (`int`): The unique id of the list value to be deleted.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An ApiResponse (`Models.ApiResponse`) containing the results of the request.
|
||||||
|
"""
|
||||||
|
|
||||||
endpoint = DeleteListItemEndpoint(self.baseUrl, listId, itemId)
|
endpoint = DeleteListItemEndpoint(self.baseUrl, listId, itemId)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user