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 Admin (email_migration_v2).
  20   *
  21   * <p>
  22   * Email Migration API lets you migrate emails of users to Google backends.</p>
  23   *
  24   * <p>
  25   * For more information about this service, see the API
  26   * <a href="https://developers.google.com/admin-sdk/email-migration/v2/" target="_blank">Documentation</a>
  27   * </p>
  28   *
  29   * @author Google, Inc.
  30   */
  31  class Google_Service_Admin extends Google_Service
  32  {
  33    /** Manage email messages of users on your domain. */
  34    const EMAIL_MIGRATION =
  35        "https://www.googleapis.com/auth/email.migration";
  36  
  37    public $mail;
  38    
  39  
  40    /**
  41     * Constructs the internal representation of the Admin service.
  42     *
  43     * @param Google_Client $client
  44     */
  45    public function __construct(Google_Client $client)
  46    {
  47      parent::__construct($client);
  48      $this->rootUrl = 'https://www.googleapis.com/';
  49      $this->servicePath = 'email/v2/users/';
  50      $this->version = 'email_migration_v2';
  51      $this->serviceName = 'admin';
  52  
  53      $this->mail = new Google_Service_Admin_Mail_Resource(
  54          $this,
  55          $this->serviceName,
  56          'mail',
  57          array(
  58            'methods' => array(
  59              'insert' => array(
  60                'path' => '{userKey}/mail',
  61                'httpMethod' => 'POST',
  62                'parameters' => array(
  63                  'userKey' => array(
  64                    'location' => 'path',
  65                    'type' => 'string',
  66                    'required' => true,
  67                  ),
  68                ),
  69              ),
  70            )
  71          )
  72      );
  73    }
  74  }
  75  
  76  
  77  /**
  78   * The "mail" collection of methods.
  79   * Typical usage is:
  80   *  <code>
  81   *   $adminService = new Google_Service_Admin(...);
  82   *   $mail = $adminService->mail;
  83   *  </code>
  84   */
  85  class Google_Service_Admin_Mail_Resource extends Google_Service_Resource
  86  {
  87  
  88    /**
  89     * Insert Mail into Google's Gmail backends (mail.insert)
  90     *
  91     * @param string $userKey The email or immutable id of the user
  92     * @param Google_MailItem $postBody
  93     * @param array $optParams Optional parameters.
  94     */
  95    public function insert($userKey, Google_Service_Admin_MailItem $postBody, $optParams = array())
  96    {
  97      $params = array('userKey' => $userKey, 'postBody' => $postBody);
  98      $params = array_merge($params, $optParams);
  99      return $this->call('insert', array($params));
 100    }
 101  }
 102  
 103  
 104  
 105  
 106  class Google_Service_Admin_MailItem extends Google_Collection
 107  {
 108    protected $collection_key = 'labels';
 109    protected $internal_gapi_mappings = array(
 110    );
 111    public $isDeleted;
 112    public $isDraft;
 113    public $isInbox;
 114    public $isSent;
 115    public $isStarred;
 116    public $isTrash;
 117    public $isUnread;
 118    public $kind;
 119    public $labels;
 120  
 121  
 122    public function setIsDeleted($isDeleted)
 123    {
 124      $this->isDeleted = $isDeleted;
 125    }
 126    public function getIsDeleted()
 127    {
 128      return $this->isDeleted;
 129    }
 130    public function setIsDraft($isDraft)
 131    {
 132      $this->isDraft = $isDraft;
 133    }
 134    public function getIsDraft()
 135    {
 136      return $this->isDraft;
 137    }
 138    public function setIsInbox($isInbox)
 139    {
 140      $this->isInbox = $isInbox;
 141    }
 142    public function getIsInbox()
 143    {
 144      return $this->isInbox;
 145    }
 146    public function setIsSent($isSent)
 147    {
 148      $this->isSent = $isSent;
 149    }
 150    public function getIsSent()
 151    {
 152      return $this->isSent;
 153    }
 154    public function setIsStarred($isStarred)
 155    {
 156      $this->isStarred = $isStarred;
 157    }
 158    public function getIsStarred()
 159    {
 160      return $this->isStarred;
 161    }
 162    public function setIsTrash($isTrash)
 163    {
 164      $this->isTrash = $isTrash;
 165    }
 166    public function getIsTrash()
 167    {
 168      return $this->isTrash;
 169    }
 170    public function setIsUnread($isUnread)
 171    {
 172      $this->isUnread = $isUnread;
 173    }
 174    public function getIsUnread()
 175    {
 176      return $this->isUnread;
 177    }
 178    public function setKind($kind)
 179    {
 180      $this->kind = $kind;
 181    }
 182    public function getKind()
 183    {
 184      return $this->kind;
 185    }
 186    public function setLabels($labels)
 187    {
 188      $this->labels = $labels;
 189    }
 190    public function getLabels()
 191    {
 192      return $this->labels;
 193    }
 194  }