public class CanvasApiFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static Integer |
CANVAS_API_VERSION |
| Constructor and Description |
|---|
CanvasApiFactory(String canvasBaseUrl)
Construct an API factory for a given instance of Canvas.
|
CanvasApiFactory(String canvasBaseUrl,
int connectTimeout,
int readTimeout)
Construct an API factory with specified timeout values
|
| Modifier and Type | Method and Description |
|---|---|
<T extends CanvasReader> |
getReader(Class<T> type,
OauthToken oauthToken)
Get a reader implementation class to perform API calls with.
|
<T extends CanvasReader> |
getReader(Class<T> type,
OauthToken oauthToken,
Integer paginationPageSize)
Get a reader implementation class to perform API calls with while specifying
an explicit page size for paginated API calls.
|
<T extends CanvasWriter> |
getWriter(Class<T> type,
OauthToken oauthToken)
Get a writer implementation to push data into Canvas.
|
<T extends CanvasWriter> |
getWriter(Class<T> type,
OauthToken oauthToken,
Boolean serializeNulls)
Get a writer implementation to push data into Canvas while being able to control the behavior of blank values.
|
public static final Integer CANVAS_API_VERSION
public CanvasApiFactory(String canvasBaseUrl)
canvasBaseUrl - The base URL used to access your Canvas instancepublic CanvasApiFactory(String canvasBaseUrl, int connectTimeout, int readTimeout)
canvasBaseUrl - The base URL used to access your Canvas instanceconnectTimeout - Connection timeout in millisecondsreadTimeout - Read timeout in milliseconds. If this is too low, longer API queries could time out prematurelypublic <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken)
T - The reader type to request an instance oftype - Interface type you wish to get an implementation foroauthToken - An OAuth token to use for authentication when making API callspublic <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken, Integer paginationPageSize)
T - The reader type to request an instance oftype - Interface type you wish to get an implementation foroauthToken - An OAuth token to use for authentication when making API callspaginationPageSize - Requested pagination page sizepublic <T extends CanvasWriter> T getWriter(Class<T> type, OauthToken oauthToken)
T - A writer implementationtype - Interface type you wish to get an implementation foroauthToken - An OAuth token to use for authentication when making API callspublic <T extends CanvasWriter> T getWriter(Class<T> type, OauthToken oauthToken, Boolean serializeNulls)
T - A writer implementationtype - Interface type you wish to get an implementation foroauthToken - An OAuth token to use for authentication when making API callsserializeNulls - Whether or not to include null fields in the serialized JSON. Defaults to false if nullCopyright © 2021 Kansas State University, Office of Mediated Education. All rights reserved.