original_string: public static function mark_complete($requestid) {
          global $USER;
  
          $warnings = [];
          $params = external_api::validate_parameters(self::mark_complete_parameters(), [
              'requestid' => $requestid,
          ]);
          $requestid = $params['requestid'];
  
          // Validate context and access to manage the registry.
          $context = context_system::instance();
          self::validate_context($context);
          api::check_can_manage_data_registry();
  
          $message = get_string('markedcomplete', 'tool_dataprivacy');
          // Update the data request record.
          if ($result = api::update_request_status($requestid, api::DATAREQUEST_STATUS_COMPLETE, $USER->id, $message)) {
              // Add notification in the session to be shown when the page is reloaded on the JS side.
              notification::success(get_string('requestmarkedcomplete', 'tool_dataprivacy'));
          }
  
          return [
              'result' => $result,
              'warnings' => $warnings
          ];
      }
code: public static function mark_complete($requestid) {
          global $USER;
  
          $warnings = [];
          $params = external_api::validate_parameters(self::mark_complete_parameters(), [
              'requestid' => $requestid,
          ]);
          $requestid = $params['requestid'];
  
          // Validate context and access to manage the registry.
          $context = context_system::instance();
          self::validate_context($context);
          api::check_can_manage_data_registry();
  
          $message = get_string('markedcomplete', 'tool_dataprivacy');
          // Update the data request record.
          if ($result = api::update_request_status($requestid, api::DATAREQUEST_STATUS_COMPLETE, $USER->id, $message)) {
              // Add notification in the session to be shown when the page is reloaded on the JS side.
              notification::success(get_string('requestmarkedcomplete', 'tool_dataprivacy'));
          }
  
          return [
              'result' => $result,
              'warnings' => $warnings
          ];
      }
code_tokens: public static function mark_complete ( $ requestid ) { global $ USER ; $ warnings = [ ] ; $ params = external_api :: validate_parameters ( self :: mark_complete_parameters ( ) , [ 'requestid' => $ requestid , ] ) ; $ requestid = $ params [ 'requestid' ] ; // Validate context and access to manage the registry. $ context = context_system :: instance ( ) ; self :: validate_context ( $ context ) ; api :: check_can_manage_data_registry ( ) ; $ message = get_string ( 'markedcomplete' , 'tool_dataprivacy' ) ; // Update the data request record. if ( $ result = api :: update_request_status ( $ requestid , api :: DATAREQUEST_STATUS_COMPLETE , $ USER -> id , $ message ) ) { // Add notification in the session to be shown when the page is reloaded on the JS side. notification :: success ( get_string ( 'requestmarkedcomplete' , 'tool_dataprivacy' ) ) ; } return [ 'result' => $ result , 'warnings' => $ warnings ] ; }
docstring: Mark a user's general enquiry's status as complete.
  
  @since Moodle 3.5.2
  @param int $requestid The request ID of the general enquiry.
  @return array
  @throws coding_exception
  @throws invalid_parameter_exception
  @throws invalid_persistent_exception
  @throws restricted_context_exception
  @throws dml_exception
  @throws moodle_exception
docstring_tokens: Mark a user s general enquiry s status as complete .