Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

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