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 Appsactivity (v1).
  20   *
  21   * <p>
  22   * Provides a historical view of activity.</p>
  23   *
  24   * <p>
  25   * For more information about this service, see the API
  26   * <a href="https://developers.google.com/google-apps/activity/" target="_blank">Documentation</a>
  27   * </p>
  28   *
  29   * @author Google, Inc.
  30   */
  31  #[AllowDynamicProperties]
  32  class Google_Service_Appsactivity extends Google_Service
  33  {
  34    /** View the activity history of your Google Apps. */
  35    const ACTIVITY =
  36        "https://www.googleapis.com/auth/activity";
  37    /** View and manage the files in your Google Drive. */
  38    const DRIVE =
  39        "https://www.googleapis.com/auth/drive";
  40    /** View and manage metadata of files in your Google Drive. */
  41    const DRIVE_METADATA =
  42        "https://www.googleapis.com/auth/drive.metadata";
  43    /** View metadata for files in your Google Drive. */
  44    const DRIVE_METADATA_READONLY =
  45        "https://www.googleapis.com/auth/drive.metadata.readonly";
  46    /** View the files in your Google Drive. */
  47    const DRIVE_READONLY =
  48        "https://www.googleapis.com/auth/drive.readonly";
  49  
  50    public $activities;
  51    
  52  
  53    /**
  54     * Constructs the internal representation of the Appsactivity service.
  55     *
  56     * @param Google_Client $client
  57     */
  58    public function __construct(Google_Client $client)
  59    {
  60      parent::__construct($client);
  61      $this->rootUrl = 'https://www.googleapis.com/';
  62      $this->servicePath = 'appsactivity/v1/';
  63      $this->version = 'v1';
  64      $this->serviceName = 'appsactivity';
  65  
  66      $this->activities = new Google_Service_Appsactivity_Activities_Resource(
  67          $this,
  68          $this->serviceName,
  69          'activities',
  70          array(
  71            'methods' => array(
  72              'list' => array(
  73                'path' => 'activities',
  74                'httpMethod' => 'GET',
  75                'parameters' => array(
  76                  'drive.ancestorId' => array(
  77                    'location' => 'query',
  78                    'type' => 'string',
  79                  ),
  80                  'pageSize' => array(
  81                    'location' => 'query',
  82                    'type' => 'integer',
  83                  ),
  84                  'pageToken' => array(
  85                    'location' => 'query',
  86                    'type' => 'string',
  87                  ),
  88                  'userId' => array(
  89                    'location' => 'query',
  90                    'type' => 'string',
  91                  ),
  92                  'groupingStrategy' => array(
  93                    'location' => 'query',
  94                    'type' => 'string',
  95                  ),
  96                  'drive.fileId' => array(
  97                    'location' => 'query',
  98                    'type' => 'string',
  99                  ),
 100                  'source' => array(
 101                    'location' => 'query',
 102                    'type' => 'string',
 103                  ),
 104                ),
 105              ),
 106            )
 107          )
 108      );
 109    }
 110  }
 111  
 112  
 113  /**
 114   * The "activities" collection of methods.
 115   * Typical usage is:
 116   *  <code>
 117   *   $appsactivityService = new Google_Service_Appsactivity(...);
 118   *   $activities = $appsactivityService->activities;
 119   *  </code>
 120   */
 121  #[AllowDynamicProperties]
 122  class Google_Service_Appsactivity_Activities_Resource extends Google_Service_Resource
 123  {
 124  
 125    /**
 126     * Returns a list of activities visible to the current logged in user. Visible
 127     * activities are determined by the visiblity settings of the object that was
 128     * acted on, e.g. Drive files a user can see. An activity is a record of past
 129     * events. Multiple events may be merged if they are similar. A request is
 130     * scoped to activities from a given Google service using the source parameter.
 131     * (activities.listActivities)
 132     *
 133     * @param array $optParams Optional parameters.
 134     *
 135     * @opt_param string drive.ancestorId Identifies the Drive folder containing the
 136     * items for which to return activities.
 137     * @opt_param int pageSize The maximum number of events to return on a page. The
 138     * response includes a continuation token if there are more events.
 139     * @opt_param string pageToken A token to retrieve a specific page of results.
 140     * @opt_param string userId Indicates the user to return activity for. Use the
 141     * special value me to indicate the currently authenticated user.
 142     * @opt_param string groupingStrategy Indicates the strategy to use when
 143     * grouping singleEvents items in the associated combinedEvent object.
 144     * @opt_param string drive.fileId Identifies the Drive item to return activities
 145     * for.
 146     * @opt_param string source The Google service from which to return activities.
 147     * Possible values of source are: - drive.google.com
 148     * @return Google_Service_Appsactivity_ListActivitiesResponse
 149     */
 150    public function listActivities($optParams = array())
 151    {
 152      $params = array();
 153      $params = array_merge($params, $optParams);
 154      return $this->call('list', array($params), "Google_Service_Appsactivity_ListActivitiesResponse");
 155    }
 156  }
 157  
 158  
 159  
 160  
 161  #[AllowDynamicProperties]
 162  class Google_Service_Appsactivity_Activity extends Google_Collection
 163  {
 164    protected $collection_key = 'singleEvents';
 165    protected $internal_gapi_mappings = array(
 166    );
 167    protected $combinedEventType = 'Google_Service_Appsactivity_Event';
 168    protected $combinedEventDataType = '';
 169    protected $singleEventsType = 'Google_Service_Appsactivity_Event';
 170    protected $singleEventsDataType = 'array';
 171  
 172  
 173    public function setCombinedEvent(Google_Service_Appsactivity_Event $combinedEvent)
 174    {
 175      $this->combinedEvent = $combinedEvent;
 176    }
 177    public function getCombinedEvent()
 178    {
 179      return $this->combinedEvent;
 180    }
 181    public function setSingleEvents($singleEvents)
 182    {
 183      $this->singleEvents = $singleEvents;
 184    }
 185    public function getSingleEvents()
 186    {
 187      return $this->singleEvents;
 188    }
 189  }
 190  
 191  #[AllowDynamicProperties]
 192  class Google_Service_Appsactivity_Event extends Google_Collection
 193  {
 194    protected $collection_key = 'permissionChanges';
 195    protected $internal_gapi_mappings = array(
 196    );
 197    public $additionalEventTypes;
 198    public $eventTimeMillis;
 199    public $fromUserDeletion;
 200    protected $moveType = 'Google_Service_Appsactivity_Move';
 201    protected $moveDataType = '';
 202    protected $permissionChangesType = 'Google_Service_Appsactivity_PermissionChange';
 203    protected $permissionChangesDataType = 'array';
 204    public $primaryEventType;
 205    protected $renameType = 'Google_Service_Appsactivity_Rename';
 206    protected $renameDataType = '';
 207    protected $targetType = 'Google_Service_Appsactivity_Target';
 208    protected $targetDataType = '';
 209    protected $userType = 'Google_Service_Appsactivity_User';
 210    protected $userDataType = '';
 211  
 212  
 213    public function setAdditionalEventTypes($additionalEventTypes)
 214    {
 215      $this->additionalEventTypes = $additionalEventTypes;
 216    }
 217    public function getAdditionalEventTypes()
 218    {
 219      return $this->additionalEventTypes;
 220    }
 221    public function setEventTimeMillis($eventTimeMillis)
 222    {
 223      $this->eventTimeMillis = $eventTimeMillis;
 224    }
 225    public function getEventTimeMillis()
 226    {
 227      return $this->eventTimeMillis;
 228    }
 229    public function setFromUserDeletion($fromUserDeletion)
 230    {
 231      $this->fromUserDeletion = $fromUserDeletion;
 232    }
 233    public function getFromUserDeletion()
 234    {
 235      return $this->fromUserDeletion;
 236    }
 237    public function setMove(Google_Service_Appsactivity_Move $move)
 238    {
 239      $this->move = $move;
 240    }
 241    public function getMove()
 242    {
 243      return $this->move;
 244    }
 245    public function setPermissionChanges($permissionChanges)
 246    {
 247      $this->permissionChanges = $permissionChanges;
 248    }
 249    public function getPermissionChanges()
 250    {
 251      return $this->permissionChanges;
 252    }
 253    public function setPrimaryEventType($primaryEventType)
 254    {
 255      $this->primaryEventType = $primaryEventType;
 256    }
 257    public function getPrimaryEventType()
 258    {
 259      return $this->primaryEventType;
 260    }
 261    public function setRename(Google_Service_Appsactivity_Rename $rename)
 262    {
 263      $this->rename = $rename;
 264    }
 265    public function getRename()
 266    {
 267      return $this->rename;
 268    }
 269    public function setTarget(Google_Service_Appsactivity_Target $target)
 270    {
 271      $this->target = $target;
 272    }
 273    public function getTarget()
 274    {
 275      return $this->target;
 276    }
 277    public function setUser(Google_Service_Appsactivity_User $user)
 278    {
 279      $this->user = $user;
 280    }
 281    public function getUser()
 282    {
 283      return $this->user;
 284    }
 285  }
 286  
 287  #[AllowDynamicProperties]
 288  class Google_Service_Appsactivity_ListActivitiesResponse extends Google_Collection
 289  {
 290    protected $collection_key = 'activities';
 291    protected $internal_gapi_mappings = array(
 292    );
 293    protected $activitiesType = 'Google_Service_Appsactivity_Activity';
 294    protected $activitiesDataType = 'array';
 295    public $nextPageToken;
 296  
 297  
 298    public function setActivities($activities)
 299    {
 300      $this->activities = $activities;
 301    }
 302    public function getActivities()
 303    {
 304      return $this->activities;
 305    }
 306    public function setNextPageToken($nextPageToken)
 307    {
 308      $this->nextPageToken = $nextPageToken;
 309    }
 310    public function getNextPageToken()
 311    {
 312      return $this->nextPageToken;
 313    }
 314  }
 315  
 316  #[AllowDynamicProperties]
 317  class Google_Service_Appsactivity_Move extends Google_Collection
 318  {
 319    protected $collection_key = 'removedParents';
 320    protected $internal_gapi_mappings = array(
 321    );
 322    protected $addedParentsType = 'Google_Service_Appsactivity_Parent';
 323    protected $addedParentsDataType = 'array';
 324    protected $removedParentsType = 'Google_Service_Appsactivity_Parent';
 325    protected $removedParentsDataType = 'array';
 326  
 327  
 328    public function setAddedParents($addedParents)
 329    {
 330      $this->addedParents = $addedParents;
 331    }
 332    public function getAddedParents()
 333    {
 334      return $this->addedParents;
 335    }
 336    public function setRemovedParents($removedParents)
 337    {
 338      $this->removedParents = $removedParents;
 339    }
 340    public function getRemovedParents()
 341    {
 342      return $this->removedParents;
 343    }
 344  }
 345  
 346  #[AllowDynamicProperties]
 347  class Google_Service_Appsactivity_Parent extends Google_Model
 348  {
 349    protected $internal_gapi_mappings = array(
 350    );
 351    public $id;
 352    public $isRoot;
 353    public $title;
 354  
 355  
 356    public function setId($id)
 357    {
 358      $this->id = $id;
 359    }
 360    public function getId()
 361    {
 362      return $this->id;
 363    }
 364    public function setIsRoot($isRoot)
 365    {
 366      $this->isRoot = $isRoot;
 367    }
 368    public function getIsRoot()
 369    {
 370      return $this->isRoot;
 371    }
 372    public function setTitle($title)
 373    {
 374      $this->title = $title;
 375    }
 376    public function getTitle()
 377    {
 378      return $this->title;
 379    }
 380  }
 381  
 382  #[AllowDynamicProperties]
 383  class Google_Service_Appsactivity_Permission extends Google_Model
 384  {
 385    protected $internal_gapi_mappings = array(
 386    );
 387    public $name;
 388    public $permissionId;
 389    public $role;
 390    public $type;
 391    protected $userType = 'Google_Service_Appsactivity_User';
 392    protected $userDataType = '';
 393    public $withLink;
 394  
 395  
 396    public function setName($name)
 397    {
 398      $this->name = $name;
 399    }
 400    public function getName()
 401    {
 402      return $this->name;
 403    }
 404    public function setPermissionId($permissionId)
 405    {
 406      $this->permissionId = $permissionId;
 407    }
 408    public function getPermissionId()
 409    {
 410      return $this->permissionId;
 411    }
 412    public function setRole($role)
 413    {
 414      $this->role = $role;
 415    }
 416    public function getRole()
 417    {
 418      return $this->role;
 419    }
 420    public function setType($type)
 421    {
 422      $this->type = $type;
 423    }
 424    public function getType()
 425    {
 426      return $this->type;
 427    }
 428    public function setUser(Google_Service_Appsactivity_User $user)
 429    {
 430      $this->user = $user;
 431    }
 432    public function getUser()
 433    {
 434      return $this->user;
 435    }
 436    public function setWithLink($withLink)
 437    {
 438      $this->withLink = $withLink;
 439    }
 440    public function getWithLink()
 441    {
 442      return $this->withLink;
 443    }
 444  }
 445  
 446  #[AllowDynamicProperties]
 447  class Google_Service_Appsactivity_PermissionChange extends Google_Collection
 448  {
 449    protected $collection_key = 'removedPermissions';
 450    protected $internal_gapi_mappings = array(
 451    );
 452    protected $addedPermissionsType = 'Google_Service_Appsactivity_Permission';
 453    protected $addedPermissionsDataType = 'array';
 454    protected $removedPermissionsType = 'Google_Service_Appsactivity_Permission';
 455    protected $removedPermissionsDataType = 'array';
 456  
 457  
 458    public function setAddedPermissions($addedPermissions)
 459    {
 460      $this->addedPermissions = $addedPermissions;
 461    }
 462    public function getAddedPermissions()
 463    {
 464      return $this->addedPermissions;
 465    }
 466    public function setRemovedPermissions($removedPermissions)
 467    {
 468      $this->removedPermissions = $removedPermissions;
 469    }
 470    public function getRemovedPermissions()
 471    {
 472      return $this->removedPermissions;
 473    }
 474  }
 475  
 476  #[AllowDynamicProperties]
 477  class Google_Service_Appsactivity_Photo extends Google_Model
 478  {
 479    protected $internal_gapi_mappings = array(
 480    );
 481    public $url;
 482  
 483  
 484    public function setUrl($url)
 485    {
 486      $this->url = $url;
 487    }
 488    public function getUrl()
 489    {
 490      return $this->url;
 491    }
 492  }
 493  
 494  #[AllowDynamicProperties]
 495  class Google_Service_Appsactivity_Rename extends Google_Model
 496  {
 497    protected $internal_gapi_mappings = array(
 498    );
 499    public $newTitle;
 500    public $oldTitle;
 501  
 502  
 503    public function setNewTitle($newTitle)
 504    {
 505      $this->newTitle = $newTitle;
 506    }
 507    public function getNewTitle()
 508    {
 509      return $this->newTitle;
 510    }
 511    public function setOldTitle($oldTitle)
 512    {
 513      $this->oldTitle = $oldTitle;
 514    }
 515    public function getOldTitle()
 516    {
 517      return $this->oldTitle;
 518    }
 519  }
 520  
 521  #[AllowDynamicProperties]
 522  class Google_Service_Appsactivity_Target extends Google_Model
 523  {
 524    protected $internal_gapi_mappings = array(
 525    );
 526    public $id;
 527    public $mimeType;
 528    public $name;
 529  
 530  
 531    public function setId($id)
 532    {
 533      $this->id = $id;
 534    }
 535    public function getId()
 536    {
 537      return $this->id;
 538    }
 539    public function setMimeType($mimeType)
 540    {
 541      $this->mimeType = $mimeType;
 542    }
 543    public function getMimeType()
 544    {
 545      return $this->mimeType;
 546    }
 547    public function setName($name)
 548    {
 549      $this->name = $name;
 550    }
 551    public function getName()
 552    {
 553      return $this->name;
 554    }
 555  }
 556  
 557  #[AllowDynamicProperties]
 558  class Google_Service_Appsactivity_User extends Google_Model
 559  {
 560    protected $internal_gapi_mappings = array(
 561    );
 562    public $name;
 563    protected $photoType = 'Google_Service_Appsactivity_Photo';
 564    protected $photoDataType = '';
 565  
 566  
 567    public function setName($name)
 568    {
 569      $this->name = $name;
 570    }
 571    public function getName()
 572    {
 573      return $this->name;
 574    }
 575    public function setPhoto(Google_Service_Appsactivity_Photo $photo)
 576    {
 577      $this->photo = $photo;
 578    }
 579    public function getPhoto()
 580    {
 581      return $this->photo;
 582    }
 583  }