MoodleNet client which handles direct outbound communication with MoodleNet instances.  
 More...
|  | 
| string const | API_SCOPE_CREATE_RESOURCE = '@moodlenet/ed-resource:write.own' | 
|  | MoodleNet scope for creating resources. 
 | 
|  | 
|  | 
|  | prepare_file_share_request_data (string $filename, string $mimetype, StreamInterface $stream, string $resourcename, string $resourcedescription,) | 
|  | Prepare the request data required for sharing a file to MoodleNet. 
 | 
|  | 
|  | 
| string const | API_CREATE_RESOURCE_URI = '/.pkg/@moodlenet/ed-resource/basic/v1/create' | 
|  | MoodleNet resource creation endpoint URI. 
 | 
|  | 
MoodleNet client which handles direct outbound communication with MoodleNet instances. 
- Copyright
- 2023 Michael Hawkins micha.nosp@m.elh@.nosp@m.moodl.nosp@m.e.co.nosp@m.m 
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 
◆ __construct()
      
        
          | core\moodlenet\moodlenet_client::__construct | ( | protected http_client | $httpclient, | 
        
          |  |  | protected client | $oauthclient ) | 
      
 
Constructor. 
- Parameters
- 
  
    | http_client | $httpclient | The httpclient object being used to perform the share. |  | client | $oauthclient | The OAuth 2 client for the MoodleNet site being shared to. |  
 
 
 
◆ create_resource_from_stored_file()
      
        
          | core\moodlenet\moodlenet_client::create_resource_from_stored_file | ( | stored_file | $file, | 
        
          |  |  | string | $resourcename, | 
        
          |  |  | string | $resourcedescription ) | 
      
 
Create a resource on MoodleNet which includes a file. 
- Parameters
- 
  
    | stored_file | $file | The file data to send to MoodleNet. |  | string | $resourcename | The name of the resource being shared. |  | string | $resourcedescription | A description of the resource being shared. |  
 
- Return values
- 
  
    | Psr\Http\Message\ResponseInterface | The HTTP client response from MoodleNet. |  
 
 
 
◆ prepare_file_share_request_data()
  
  | 
        
          | core\moodlenet\moodlenet_client::prepare_file_share_request_data | ( | string | $filename, |  
          |  |  | string | $mimetype, |  
          |  |  | StreamInterface | $stream, |  
          |  |  | string | $resourcename, |  
          |  |  | string | $resourcedescription ) |  | protected | 
 
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.
- Parameters
- 
  
    | string | $filename | Name of the file being shared. |  | string | $mimetype | Mime type of the file being shared. |  | StreamInterface | $stream | Stream of the file being shared. |  | string | $resourcename | The name of the resource being shared. |  | string | $resourcedescription | A description of the resource being shared. |  
 
- Return values
- 
  
    | array | Data in the format required to send a file to MoodleNet using core\httpclient. |  
 
 
 
The documentation for this class was generated from the following file: