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 DataTransfer (datatransfer_v1).
  20   *
  21   * <p>
  22   * Admin Data Transfer API lets you transfer user data from one user to another.</p>
  23   *
  24   * <p>
  25   * For more information about this service, see the API
  26   * <a href="https://developers.google.com/admin-sdk/data-transfer/" target="_blank">Documentation</a>
  27   * </p>
  28   *
  29   * @author Google, Inc.
  30   */
  31  #[AllowDynamicProperties]
  32  class Google_Service_DataTransfer extends Google_Service
  33  {
  34    /** View and manage data transfers between users in your organization. */
  35    const ADMIN_DATATRANSFER =
  36        "https://www.googleapis.com/auth/admin.datatransfer";
  37    /** View data transfers between users in your organization. */
  38    const ADMIN_DATATRANSFER_READONLY =
  39        "https://www.googleapis.com/auth/admin.datatransfer.readonly";
  40  
  41    public $applications;
  42    public $transfers;
  43    
  44  
  45    /**
  46     * Constructs the internal representation of the DataTransfer service.
  47     *
  48     * @param Google_Client $client
  49     */
  50    public function __construct(Google_Client $client)
  51    {
  52      parent::__construct($client);
  53      $this->rootUrl = 'https://www.googleapis.com/';
  54      $this->servicePath = 'admin/datatransfer/v1/';
  55      $this->version = 'datatransfer_v1';
  56      $this->serviceName = 'admin';
  57  
  58      $this->applications = new Google_Service_DataTransfer_Applications_Resource(
  59          $this,
  60          $this->serviceName,
  61          'applications',
  62          array(
  63            'methods' => array(
  64              'get' => array(
  65                'path' => 'applications/{applicationId}',
  66                'httpMethod' => 'GET',
  67                'parameters' => array(
  68                  'applicationId' => array(
  69                    'location' => 'path',
  70                    'type' => 'string',
  71                    'required' => true,
  72                  ),
  73                ),
  74              ),'list' => array(
  75                'path' => 'applications',
  76                'httpMethod' => 'GET',
  77                'parameters' => array(
  78                  'pageToken' => array(
  79                    'location' => 'query',
  80                    'type' => 'string',
  81                  ),
  82                  'customerId' => array(
  83                    'location' => 'query',
  84                    'type' => 'string',
  85                  ),
  86                  'maxResults' => array(
  87                    'location' => 'query',
  88                    'type' => 'integer',
  89                  ),
  90                ),
  91              ),
  92            )
  93          )
  94      );
  95      $this->transfers = new Google_Service_DataTransfer_Transfers_Resource(
  96          $this,
  97          $this->serviceName,
  98          'transfers',
  99          array(
 100            'methods' => array(
 101              'get' => array(
 102                'path' => 'transfers/{dataTransferId}',
 103                'httpMethod' => 'GET',
 104                'parameters' => array(
 105                  'dataTransferId' => array(
 106                    'location' => 'path',
 107                    'type' => 'string',
 108                    'required' => true,
 109                  ),
 110                ),
 111              ),'insert' => array(
 112                'path' => 'transfers',
 113                'httpMethod' => 'POST',
 114                'parameters' => array(),
 115              ),'list' => array(
 116                'path' => 'transfers',
 117                'httpMethod' => 'GET',
 118                'parameters' => array(
 119                  'status' => array(
 120                    'location' => 'query',
 121                    'type' => 'string',
 122                  ),
 123                  'maxResults' => array(
 124                    'location' => 'query',
 125                    'type' => 'integer',
 126                  ),
 127                  'newOwnerUserId' => array(
 128                    'location' => 'query',
 129                    'type' => 'string',
 130                  ),
 131                  'oldOwnerUserId' => array(
 132                    'location' => 'query',
 133                    'type' => 'string',
 134                  ),
 135                  'pageToken' => array(
 136                    'location' => 'query',
 137                    'type' => 'string',
 138                  ),
 139                  'customerId' => array(
 140                    'location' => 'query',
 141                    'type' => 'string',
 142                  ),
 143                ),
 144              ),
 145            )
 146          )
 147      );
 148    }
 149  }
 150  
 151  
 152  /**
 153   * The "applications" collection of methods.
 154   * Typical usage is:
 155   *  <code>
 156   *   $adminService = new Google_Service_DataTransfer(...);
 157   *   $applications = $adminService->applications;
 158   *  </code>
 159   */
 160  #[AllowDynamicProperties]
 161  class Google_Service_DataTransfer_Applications_Resource extends Google_Service_Resource
 162  {
 163  
 164    /**
 165     * Retrieves information about an application for the given application ID.
 166     * (applications.get)
 167     *
 168     * @param string $applicationId ID of the application resource to be retrieved.
 169     * @param array $optParams Optional parameters.
 170     * @return Google_Service_DataTransfer_Application
 171     */
 172    public function get($applicationId, $optParams = array())
 173    {
 174      $params = array('applicationId' => $applicationId);
 175      $params = array_merge($params, $optParams);
 176      return $this->call('get', array($params), "Google_Service_DataTransfer_Application");
 177    }
 178  
 179    /**
 180     * Lists the applications available for data transfer for a customer.
 181     * (applications.listApplications)
 182     *
 183     * @param array $optParams Optional parameters.
 184     *
 185     * @opt_param string pageToken Token to specify next page in the list.
 186     * @opt_param string customerId Immutable ID of the Google Apps account.
 187     * @opt_param string maxResults Maximum number of results to return. Default is
 188     * 100.
 189     * @return Google_Service_DataTransfer_ApplicationsListResponse
 190     */
 191    public function listApplications($optParams = array())
 192    {
 193      $params = array();
 194      $params = array_merge($params, $optParams);
 195      return $this->call('list', array($params), "Google_Service_DataTransfer_ApplicationsListResponse");
 196    }
 197  }
 198  
 199  /**
 200   * The "transfers" collection of methods.
 201   * Typical usage is:
 202   *  <code>
 203   *   $adminService = new Google_Service_DataTransfer(...);
 204   *   $transfers = $adminService->transfers;
 205   *  </code>
 206   */
 207  #[AllowDynamicProperties]
 208  class Google_Service_DataTransfer_Transfers_Resource extends Google_Service_Resource
 209  {
 210  
 211    /**
 212     * Retrieves a data transfer request by its resource ID. (transfers.get)
 213     *
 214     * @param string $dataTransferId ID of the resource to be retrieved. This is
 215     * returned in the response from the insert method.
 216     * @param array $optParams Optional parameters.
 217     * @return Google_Service_DataTransfer_DataTransfer
 218     */
 219    public function get($dataTransferId, $optParams = array())
 220    {
 221      $params = array('dataTransferId' => $dataTransferId);
 222      $params = array_merge($params, $optParams);
 223      return $this->call('get', array($params), "Google_Service_DataTransfer_DataTransfer");
 224    }
 225  
 226    /**
 227     * Inserts a data transfer request. (transfers.insert)
 228     *
 229     * @param Google_DataTransfer $postBody
 230     * @param array $optParams Optional parameters.
 231     * @return Google_Service_DataTransfer_DataTransfer
 232     */
 233    public function insert(Google_Service_DataTransfer_DataTransfer $postBody, $optParams = array())
 234    {
 235      $params = array('postBody' => $postBody);
 236      $params = array_merge($params, $optParams);
 237      return $this->call('insert', array($params), "Google_Service_DataTransfer_DataTransfer");
 238    }
 239  
 240    /**
 241     * Lists the transfers for a customer by source user, destination user, or
 242     * status. (transfers.listTransfers)
 243     *
 244     * @param array $optParams Optional parameters.
 245     *
 246     * @opt_param string status Status of the transfer.
 247     * @opt_param int maxResults Maximum number of results to return. Default is
 248     * 100.
 249     * @opt_param string newOwnerUserId Destination user's profile ID.
 250     * @opt_param string oldOwnerUserId Source user's profile ID.
 251     * @opt_param string pageToken Token to specify the next page in the list.
 252     * @opt_param string customerId Immutable ID of the Google Apps account.
 253     * @return Google_Service_DataTransfer_DataTransfersListResponse
 254     */
 255    public function listTransfers($optParams = array())
 256    {
 257      $params = array();
 258      $params = array_merge($params, $optParams);
 259      return $this->call('list', array($params), "Google_Service_DataTransfer_DataTransfersListResponse");
 260    }
 261  }
 262  
 263  
 264  
 265  
 266  #[AllowDynamicProperties]
 267  class Google_Service_DataTransfer_Application extends Google_Collection
 268  {
 269    protected $collection_key = 'transferParams';
 270    protected $internal_gapi_mappings = array(
 271    );
 272    public $etag;
 273    public $id;
 274    public $kind;
 275    public $name;
 276    protected $transferParamsType = 'Google_Service_DataTransfer_ApplicationTransferParam';
 277    protected $transferParamsDataType = 'array';
 278  
 279  
 280    public function setEtag($etag)
 281    {
 282      $this->etag = $etag;
 283    }
 284    public function getEtag()
 285    {
 286      return $this->etag;
 287    }
 288    public function setId($id)
 289    {
 290      $this->id = $id;
 291    }
 292    public function getId()
 293    {
 294      return $this->id;
 295    }
 296    public function setKind($kind)
 297    {
 298      $this->kind = $kind;
 299    }
 300    public function getKind()
 301    {
 302      return $this->kind;
 303    }
 304    public function setName($name)
 305    {
 306      $this->name = $name;
 307    }
 308    public function getName()
 309    {
 310      return $this->name;
 311    }
 312    public function setTransferParams($transferParams)
 313    {
 314      $this->transferParams = $transferParams;
 315    }
 316    public function getTransferParams()
 317    {
 318      return $this->transferParams;
 319    }
 320  }
 321  
 322  #[AllowDynamicProperties]
 323  class Google_Service_DataTransfer_ApplicationDataTransfer extends Google_Collection
 324  {
 325    protected $collection_key = 'applicationTransferParams';
 326    protected $internal_gapi_mappings = array(
 327    );
 328    public $applicationId;
 329    protected $applicationTransferParamsType = 'Google_Service_DataTransfer_ApplicationTransferParam';
 330    protected $applicationTransferParamsDataType = 'array';
 331    public $applicationTransferStatus;
 332  
 333  
 334    public function setApplicationId($applicationId)
 335    {
 336      $this->applicationId = $applicationId;
 337    }
 338    public function getApplicationId()
 339    {
 340      return $this->applicationId;
 341    }
 342    public function setApplicationTransferParams($applicationTransferParams)
 343    {
 344      $this->applicationTransferParams = $applicationTransferParams;
 345    }
 346    public function getApplicationTransferParams()
 347    {
 348      return $this->applicationTransferParams;
 349    }
 350    public function setApplicationTransferStatus($applicationTransferStatus)
 351    {
 352      $this->applicationTransferStatus = $applicationTransferStatus;
 353    }
 354    public function getApplicationTransferStatus()
 355    {
 356      return $this->applicationTransferStatus;
 357    }
 358  }
 359  
 360  #[AllowDynamicProperties]
 361  class Google_Service_DataTransfer_ApplicationTransferParam extends Google_Collection
 362  {
 363    protected $collection_key = 'value';
 364    protected $internal_gapi_mappings = array(
 365    );
 366    public $key;
 367    public $value;
 368  
 369  
 370    public function setKey($key)
 371    {
 372      $this->key = $key;
 373    }
 374    public function getKey()
 375    {
 376      return $this->key;
 377    }
 378    public function setValue($value)
 379    {
 380      $this->value = $value;
 381    }
 382    public function getValue()
 383    {
 384      return $this->value;
 385    }
 386  }
 387  
 388  #[AllowDynamicProperties]
 389  class Google_Service_DataTransfer_ApplicationsListResponse extends Google_Collection
 390  {
 391    protected $collection_key = 'applications';
 392    protected $internal_gapi_mappings = array(
 393    );
 394    protected $applicationsType = 'Google_Service_DataTransfer_Application';
 395    protected $applicationsDataType = 'array';
 396    public $etag;
 397    public $kind;
 398    public $nextPageToken;
 399  
 400  
 401    public function setApplications($applications)
 402    {
 403      $this->applications = $applications;
 404    }
 405    public function getApplications()
 406    {
 407      return $this->applications;
 408    }
 409    public function setEtag($etag)
 410    {
 411      $this->etag = $etag;
 412    }
 413    public function getEtag()
 414    {
 415      return $this->etag;
 416    }
 417    public function setKind($kind)
 418    {
 419      $this->kind = $kind;
 420    }
 421    public function getKind()
 422    {
 423      return $this->kind;
 424    }
 425    public function setNextPageToken($nextPageToken)
 426    {
 427      $this->nextPageToken = $nextPageToken;
 428    }
 429    public function getNextPageToken()
 430    {
 431      return $this->nextPageToken;
 432    }
 433  }
 434  
 435  #[AllowDynamicProperties]
 436  class Google_Service_DataTransfer_DataTransfer extends Google_Collection
 437  {
 438    protected $collection_key = 'applicationDataTransfers';
 439    protected $internal_gapi_mappings = array(
 440    );
 441    protected $applicationDataTransfersType = 'Google_Service_DataTransfer_ApplicationDataTransfer';
 442    protected $applicationDataTransfersDataType = 'array';
 443    public $etag;
 444    public $id;
 445    public $kind;
 446    public $newOwnerUserId;
 447    public $oldOwnerUserId;
 448    public $overallTransferStatusCode;
 449    public $requestTime;
 450  
 451  
 452    public function setApplicationDataTransfers($applicationDataTransfers)
 453    {
 454      $this->applicationDataTransfers = $applicationDataTransfers;
 455    }
 456    public function getApplicationDataTransfers()
 457    {
 458      return $this->applicationDataTransfers;
 459    }
 460    public function setEtag($etag)
 461    {
 462      $this->etag = $etag;
 463    }
 464    public function getEtag()
 465    {
 466      return $this->etag;
 467    }
 468    public function setId($id)
 469    {
 470      $this->id = $id;
 471    }
 472    public function getId()
 473    {
 474      return $this->id;
 475    }
 476    public function setKind($kind)
 477    {
 478      $this->kind = $kind;
 479    }
 480    public function getKind()
 481    {
 482      return $this->kind;
 483    }
 484    public function setNewOwnerUserId($newOwnerUserId)
 485    {
 486      $this->newOwnerUserId = $newOwnerUserId;
 487    }
 488    public function getNewOwnerUserId()
 489    {
 490      return $this->newOwnerUserId;
 491    }
 492    public function setOldOwnerUserId($oldOwnerUserId)
 493    {
 494      $this->oldOwnerUserId = $oldOwnerUserId;
 495    }
 496    public function getOldOwnerUserId()
 497    {
 498      return $this->oldOwnerUserId;
 499    }
 500    public function setOverallTransferStatusCode($overallTransferStatusCode)
 501    {
 502      $this->overallTransferStatusCode = $overallTransferStatusCode;
 503    }
 504    public function getOverallTransferStatusCode()
 505    {
 506      return $this->overallTransferStatusCode;
 507    }
 508    public function setRequestTime($requestTime)
 509    {
 510      $this->requestTime = $requestTime;
 511    }
 512    public function getRequestTime()
 513    {
 514      return $this->requestTime;
 515    }
 516  }
 517  
 518  #[AllowDynamicProperties]
 519  class Google_Service_DataTransfer_DataTransfersListResponse extends Google_Collection
 520  {
 521    protected $collection_key = 'dataTransfers';
 522    protected $internal_gapi_mappings = array(
 523    );
 524    protected $dataTransfersType = 'Google_Service_DataTransfer_DataTransfer';
 525    protected $dataTransfersDataType = 'array';
 526    public $etag;
 527    public $kind;
 528    public $nextPageToken;
 529  
 530  
 531    public function setDataTransfers($dataTransfers)
 532    {
 533      $this->dataTransfers = $dataTransfers;
 534    }
 535    public function getDataTransfers()
 536    {
 537      return $this->dataTransfers;
 538    }
 539    public function setEtag($etag)
 540    {
 541      $this->etag = $etag;
 542    }
 543    public function getEtag()
 544    {
 545      return $this->etag;
 546    }
 547    public function setKind($kind)
 548    {
 549      $this->kind = $kind;
 550    }
 551    public function getKind()
 552    {
 553      return $this->kind;
 554    }
 555    public function setNextPageToken($nextPageToken)
 556    {
 557      $this->nextPageToken = $nextPageToken;
 558    }
 559    public function getNextPageToken()
 560    {
 561      return $this->nextPageToken;
 562    }
 563  }