Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
core\oauth2\rest Class Reference

Rest API base class mapping rest api methods to endpoints with http methods, args and post body. More...

Inheritance diagram for core\oauth2\rest:
fileconverter_googledrive\rest repository_googledocs\rest repository_nextcloud\ocs_client repository_onedrive\rest

Public Member Functions

 __construct (curl $curl)
 Constructor. More...
 
 call ($functionname, $functionargs, $rawpost=false, $contenttype=false)
 Call a function from the Api with a set of arguments and optional data. More...
 
 get_api_functions ()
 Abstract function to define the functions of the rest API. More...
 

Protected Attributes

curl $curl
 $curl
 

Detailed Description

Rest API base class mapping rest api methods to endpoints with http methods, args and post body.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core\oauth2\rest::__construct ( curl  $curl)

Constructor.

Parameters
curl$curl

Member Function Documentation

◆ call()

core\oauth2\rest::call (   $functionname,
  $functionargs,
  $rawpost = false,
  $contenttype = false 
)

Call a function from the Api with a set of arguments and optional data.

Parameters
string$functionname
array$functionargs
string$rawpostOptional param to include in the body of a post.
string$contenttypeThe MIME type for the request's Content-Type header.
Return values
string|stdClass

Reimplemented in repository_nextcloud\ocs_client.

◆ get_api_functions()

core\oauth2\rest::get_api_functions ( )
abstract

Abstract function to define the functions of the rest API.

Return values
arrayExample: [ 'listFiles' => [ 'method' => 'get', 'args' => [ 'folder' => PARAM_STRING ], 'response' => 'json' ] ]

Reimplemented in repository_onedrive\rest, repository_nextcloud\ocs_client, repository_googledocs\rest, and fileconverter_googledrive\rest.


The documentation for this class was generated from the following file: