Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

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