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