Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | List of all members
core_badges\backpack_api2p1_mapping Class Reference

Represent a single method for the remote api and this class using for Open Badge API v2.1 methods. More...

Public Member Functions

 __construct ($action, $url, $postparams, $multiple, $method, $json, $authrequired, $isuserbackpack, $backpackapiversion)
 Create a mapping. More...
 
 is_match ($action)
 Does the action match this mapping? More...
 
 request ($apiurl, $tokenkey, $post=[])
 Make an api request and parse the response. More...
 

Public Attributes

string $action
 The action of this method.
 
boolean $authrequired
 Authentication is required for this request.
 
boolean $json
 json decode the response.
 
string $method
 get or post methods.
 
boolean $multiple
 This method returns an array of responses.
 
array $params
 List of parameters for this method.
 

Detailed Description

Represent a single method for the remote api and this class using for Open Badge API v2.1 methods.

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

Constructor & Destructor Documentation

◆ __construct()

core_badges\backpack_api2p1_mapping::__construct (   $action,
  $url,
  $postparams,
  $multiple,
  $method,
  $json,
  $authrequired,
  $isuserbackpack,
  $backpackapiversion 
)

Create a mapping.

Parameters
string$actionThe action of this method.
string$urlThe base url of this backpack.
mixed$postparamsList of parameters for this method.
boolean$multipleThis method returns an array of responses.
string$methodget or post methods.
boolean$jsonjson decode the response.
boolean$authrequiredAuthentication is required for this request.
boolean$isuserbackpackuser backpack or a site backpack.
integer$backpackapiversionOpenBadges version 1 or 2.

Member Function Documentation

◆ is_match()

core_badges\backpack_api2p1_mapping::is_match (   $action)

Does the action match this mapping?

Parameters
string$actionThe action.
Return values
boolean

◆ request()

core_badges\backpack_api2p1_mapping::request (   $apiurl,
  $tokenkey,
  $post = [] 
)

Make an api request and parse the response.

Parameters
string$apiurlRaw request url.
string$tokenkeyto verify authorization.
array$postrequest method.
Return values
bool|mixed

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