(no description)
File Size: | 139 lines (5 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
moodlenet_client:: (3 methods):
__construct()
create_resource_from_stored_file()
prepare_file_share_request_data()
Class: moodlenet_client - X-Ref
MoodleNet client which handles direct outbound communication with MoodleNet instances.__construct(protected http_client $httpclient,protected client $oauthclient,) X-Ref |
Constructor. param: http_client $httpclient The httpclient object being used to perform the share. param: client $oauthclient The OAuth 2 client for the MoodleNet site being shared to. |
create_resource_from_stored_file(stored_file $file,string $resourcename,string $resourcedescription,) X-Ref |
Create a resource on MoodleNet which includes a file. param: stored_file $file The file data to send to MoodleNet. param: string $resourcename The name of the resource being shared. param: string $resourcedescription A description of the resource being shared. return: \Psr\Http\Message\ResponseInterface The HTTP client response from MoodleNet. |
prepare_file_share_request_data(string $filename,string $mimetype,StreamInterface $stream,string $resourcename,string $resourcedescription,) X-Ref |
Prepare the request data required for sharing a file to MoodleNet. This creates an array in the format used by \core\httpclient options to send a multipart request. param: string $filename Name of the file being shared. param: string $mimetype Mime type of the file being shared. param: StreamInterface $stream Stream of the file being shared. param: string $resourcename The name of the resource being shared. param: string $resourcedescription A description of the resource being shared. return: array Data in the format required to send a file to MoodleNet using \core\httpclient. |