Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

   1  <?php
   2  /*
   3   * Copyright 2010 Google Inc.
   4   *
   5   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
   6   * use this file except in compliance with the License. You may obtain a copy of
   7   * the License at
   8   *
   9   * http://www.apache.org/licenses/LICENSE-2.0
  10   *
  11   * Unless required by applicable law or agreed to in writing, software
  12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14   * License for the specific language governing permissions and limitations under
  15   * the License.
  16   */
  17  
  18  /**
  19   * Service definition for Audit (v1).
  20   *
  21   * <p>
  22   * Lets you access user activities in your enterprise made through various
  23   * applications.</p>
  24   *
  25   * <p>
  26   * For more information about this service, see the API
  27   * <a href="https://developers.google.com/google-apps/admin-audit/get_started" target="_blank">Documentation</a>
  28   * </p>
  29   *
  30   * @author Google, Inc.
  31   */
  32  #[AllowDynamicProperties]
  33  class Google_Service_Audit extends Google_Service
  34  {
  35  
  36  
  37    public $activities;
  38    
  39  
  40    /**
  41     * Constructs the internal representation of the Audit service.
  42     *
  43     * @param Google_Client $client
  44     */
  45    public function __construct(Google_Client $client)
  46    {
  47      parent::__construct($client);
  48      $this->servicePath = 'apps/reporting/audit/v1/';
  49      $this->version = 'v1';
  50      $this->serviceName = 'audit';
  51  
  52      $this->activities = new Google_Service_Audit_Activities_Resource(
  53          $this,
  54          $this->serviceName,
  55          'activities',
  56          array(
  57            'methods' => array(
  58              'list' => array(
  59                'path' => '{customerId}/{applicationId}',
  60                'httpMethod' => 'GET',
  61                'parameters' => array(
  62                  'customerId' => array(
  63                    'location' => 'path',
  64                    'type' => 'string',
  65                    'required' => true,
  66                  ),
  67                  'applicationId' => array(
  68                    'location' => 'path',
  69                    'type' => 'string',
  70                    'required' => true,
  71                  ),
  72                  'actorEmail' => array(
  73                    'location' => 'query',
  74                    'type' => 'string',
  75                  ),
  76                  'actorApplicationId' => array(
  77                    'location' => 'query',
  78                    'type' => 'string',
  79                  ),
  80                  'actorIpAddress' => array(
  81                    'location' => 'query',
  82                    'type' => 'string',
  83                  ),
  84                  'caller' => array(
  85                    'location' => 'query',
  86                    'type' => 'string',
  87                  ),
  88                  'maxResults' => array(
  89                    'location' => 'query',
  90                    'type' => 'integer',
  91                  ),
  92                  'eventName' => array(
  93                    'location' => 'query',
  94                    'type' => 'string',
  95                  ),
  96                  'startTime' => array(
  97                    'location' => 'query',
  98                    'type' => 'string',
  99                  ),
 100                  'endTime' => array(
 101                    'location' => 'query',
 102                    'type' => 'string',
 103                  ),
 104                  'continuationToken' => array(
 105                    'location' => 'query',
 106                    'type' => 'string',
 107                  ),
 108                ),
 109              ),
 110            )
 111          )
 112      );
 113    }
 114  }
 115  
 116  
 117  /**
 118   * The "activities" collection of methods.
 119   * Typical usage is:
 120   *  <code>
 121   *   $auditService = new Google_Service_Audit(...);
 122   *   $activities = $auditService->activities;
 123   *  </code>
 124   */
 125  #[AllowDynamicProperties]
 126  class Google_Service_Audit_Activities_Resource extends Google_Service_Resource
 127  {
 128  
 129    /**
 130     * Retrieves a list of activities for a specific customer and application.
 131     * (activities.listActivities)
 132     *
 133     * @param string $customerId Represents the customer who is the owner of target
 134     * object on which action was performed.
 135     * @param string $applicationId Application ID of the application on which the
 136     * event was performed.
 137     * @param array $optParams Optional parameters.
 138     *
 139     * @opt_param string actorEmail Email address of the user who performed the
 140     * action.
 141     * @opt_param string actorApplicationId Application ID of the application which
 142     * interacted on behalf of the user while performing the event.
 143     * @opt_param string actorIpAddress IP Address of host where the event was
 144     * performed. Supports both IPv4 and IPv6 addresses.
 145     * @opt_param string caller Type of the caller.
 146     * @opt_param int maxResults Number of activity records to be shown in each
 147     * page.
 148     * @opt_param string eventName Name of the event being queried.
 149     * @opt_param string startTime Return events which occured at or after this
 150     * time.
 151     * @opt_param string endTime Return events which occured at or before this time.
 152     * @opt_param string continuationToken Next page URL.
 153     * @return Google_Service_Audit_Activities
 154     */
 155    public function listActivities($customerId, $applicationId, $optParams = array())
 156    {
 157      $params = array('customerId' => $customerId, 'applicationId' => $applicationId);
 158      $params = array_merge($params, $optParams);
 159      return $this->call('list', array($params), "Google_Service_Audit_Activities");
 160    }
 161  }
 162  
 163  
 164  
 165  
 166  #[AllowDynamicProperties]
 167  class Google_Service_Audit_Activities extends Google_Collection
 168  {
 169    protected $collection_key = 'items';
 170    protected $internal_gapi_mappings = array(
 171    );
 172    protected $itemsType = 'Google_Service_Audit_Activity';
 173    protected $itemsDataType = 'array';
 174    public $kind;
 175    public $next;
 176  
 177  
 178    public function setItems($items)
 179    {
 180      $this->items = $items;
 181    }
 182    public function getItems()
 183    {
 184      return $this->items;
 185    }
 186    public function setKind($kind)
 187    {
 188      $this->kind = $kind;
 189    }
 190    public function getKind()
 191    {
 192      return $this->kind;
 193    }
 194    public function setNext($next)
 195    {
 196      $this->next = $next;
 197    }
 198    public function getNext()
 199    {
 200      return $this->next;
 201    }
 202  }
 203  
 204  #[AllowDynamicProperties]
 205  class Google_Service_Audit_Activity extends Google_Collection
 206  {
 207    protected $collection_key = 'events';
 208    protected $internal_gapi_mappings = array(
 209    );
 210    protected $actorType = 'Google_Service_Audit_ActivityActor';
 211    protected $actorDataType = '';
 212    protected $eventsType = 'Google_Service_Audit_ActivityEvents';
 213    protected $eventsDataType = 'array';
 214    protected $idType = 'Google_Service_Audit_ActivityId';
 215    protected $idDataType = '';
 216    public $ipAddress;
 217    public $kind;
 218    public $ownerDomain;
 219  
 220  
 221    public function setActor(Google_Service_Audit_ActivityActor $actor)
 222    {
 223      $this->actor = $actor;
 224    }
 225    public function getActor()
 226    {
 227      return $this->actor;
 228    }
 229    public function setEvents($events)
 230    {
 231      $this->events = $events;
 232    }
 233    public function getEvents()
 234    {
 235      return $this->events;
 236    }
 237    public function setId(Google_Service_Audit_ActivityId $id)
 238    {
 239      $this->id = $id;
 240    }
 241    public function getId()
 242    {
 243      return $this->id;
 244    }
 245    public function setIpAddress($ipAddress)
 246    {
 247      $this->ipAddress = $ipAddress;
 248    }
 249    public function getIpAddress()
 250    {
 251      return $this->ipAddress;
 252    }
 253    public function setKind($kind)
 254    {
 255      $this->kind = $kind;
 256    }
 257    public function getKind()
 258    {
 259      return $this->kind;
 260    }
 261    public function setOwnerDomain($ownerDomain)
 262    {
 263      $this->ownerDomain = $ownerDomain;
 264    }
 265    public function getOwnerDomain()
 266    {
 267      return $this->ownerDomain;
 268    }
 269  }
 270  
 271  #[AllowDynamicProperties]
 272  class Google_Service_Audit_ActivityActor extends Google_Model
 273  {
 274    protected $internal_gapi_mappings = array(
 275    );
 276    public $applicationId;
 277    public $callerType;
 278    public $email;
 279    public $key;
 280  
 281  
 282    public function setApplicationId($applicationId)
 283    {
 284      $this->applicationId = $applicationId;
 285    }
 286    public function getApplicationId()
 287    {
 288      return $this->applicationId;
 289    }
 290    public function setCallerType($callerType)
 291    {
 292      $this->callerType = $callerType;
 293    }
 294    public function getCallerType()
 295    {
 296      return $this->callerType;
 297    }
 298    public function setEmail($email)
 299    {
 300      $this->email = $email;
 301    }
 302    public function getEmail()
 303    {
 304      return $this->email;
 305    }
 306    public function setKey($key)
 307    {
 308      $this->key = $key;
 309    }
 310    public function getKey()
 311    {
 312      return $this->key;
 313    }
 314  }
 315  
 316  #[AllowDynamicProperties]
 317  class Google_Service_Audit_ActivityEvents extends Google_Collection
 318  {
 319    protected $collection_key = 'parameters';
 320    protected $internal_gapi_mappings = array(
 321    );
 322    public $eventType;
 323    public $name;
 324    protected $parametersType = 'Google_Service_Audit_ActivityEventsParameters';
 325    protected $parametersDataType = 'array';
 326  
 327  
 328    public function setEventType($eventType)
 329    {
 330      $this->eventType = $eventType;
 331    }
 332    public function getEventType()
 333    {
 334      return $this->eventType;
 335    }
 336    public function setName($name)
 337    {
 338      $this->name = $name;
 339    }
 340    public function getName()
 341    {
 342      return $this->name;
 343    }
 344    public function setParameters($parameters)
 345    {
 346      $this->parameters = $parameters;
 347    }
 348    public function getParameters()
 349    {
 350      return $this->parameters;
 351    }
 352  }
 353  
 354  #[AllowDynamicProperties]
 355  class Google_Service_Audit_ActivityEventsParameters extends Google_Model
 356  {
 357    protected $internal_gapi_mappings = array(
 358    );
 359    public $name;
 360    public $value;
 361  
 362  
 363    public function setName($name)
 364    {
 365      $this->name = $name;
 366    }
 367    public function getName()
 368    {
 369      return $this->name;
 370    }
 371    public function setValue($value)
 372    {
 373      $this->value = $value;
 374    }
 375    public function getValue()
 376    {
 377      return $this->value;
 378    }
 379  }
 380  
 381  #[AllowDynamicProperties]
 382  class Google_Service_Audit_ActivityId extends Google_Model
 383  {
 384    protected $internal_gapi_mappings = array(
 385    );
 386    public $applicationId;
 387    public $customerId;
 388    public $time;
 389    public $uniqQualifier;
 390  
 391  
 392    public function setApplicationId($applicationId)
 393    {
 394      $this->applicationId = $applicationId;
 395    }
 396    public function getApplicationId()
 397    {
 398      return $this->applicationId;
 399    }
 400    public function setCustomerId($customerId)
 401    {
 402      $this->customerId = $customerId;
 403    }
 404    public function getCustomerId()
 405    {
 406      return $this->customerId;
 407    }
 408    public function setTime($time)
 409    {
 410      $this->time = $time;
 411    }
 412    public function getTime()
 413    {
 414      return $this->time;
 415    }
 416    public function setUniqQualifier($uniqQualifier)
 417    {
 418      $this->uniqQualifier = $uniqQualifier;
 419    }
 420    public function getUniqQualifier()
 421    {
 422      return $this->uniqQualifier;
 423    }
 424  }