Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [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 Webfonts (v1).
  20   *
  21   * <p>
  22   * The Google Fonts Developer API.</p>
  23   *
  24   * <p>
  25   * For more information about this service, see the API
  26   * <a href="https://developers.google.com/fonts/docs/developer_api" target="_blank">Documentation</a>
  27   * </p>
  28   *
  29   * @author Google, Inc.
  30   */
  31  class Google_Service_Webfonts extends Google_Service
  32  {
  33  
  34  
  35    public $webfonts;
  36    
  37  
  38    /**
  39     * Constructs the internal representation of the Webfonts service.
  40     *
  41     * @param Google_Client $client
  42     */
  43    public function __construct(Google_Client $client)
  44    {
  45      parent::__construct($client);
  46      $this->rootUrl = 'https://www.googleapis.com/';
  47      $this->servicePath = 'webfonts/v1/';
  48      $this->version = 'v1';
  49      $this->serviceName = 'webfonts';
  50  
  51      $this->webfonts = new Google_Service_Webfonts_Webfonts_Resource(
  52          $this,
  53          $this->serviceName,
  54          'webfonts',
  55          array(
  56            'methods' => array(
  57              'list' => array(
  58                'path' => 'webfonts',
  59                'httpMethod' => 'GET',
  60                'parameters' => array(
  61                  'sort' => array(
  62                    'location' => 'query',
  63                    'type' => 'string',
  64                  ),
  65                ),
  66              ),
  67            )
  68          )
  69      );
  70    }
  71  }
  72  
  73  
  74  /**
  75   * The "webfonts" collection of methods.
  76   * Typical usage is:
  77   *  <code>
  78   *   $webfontsService = new Google_Service_Webfonts(...);
  79   *   $webfonts = $webfontsService->webfonts;
  80   *  </code>
  81   */
  82  class Google_Service_Webfonts_Webfonts_Resource extends Google_Service_Resource
  83  {
  84  
  85    /**
  86     * Retrieves the list of fonts currently served by the Google Fonts Developer
  87     * API (webfonts.listWebfonts)
  88     *
  89     * @param array $optParams Optional parameters.
  90     *
  91     * @opt_param string sort Enables sorting of the list
  92     * @return Google_Service_Webfonts_WebfontList
  93     */
  94    public function listWebfonts($optParams = array())
  95    {
  96      $params = array();
  97      $params = array_merge($params, $optParams);
  98      return $this->call('list', array($params), "Google_Service_Webfonts_WebfontList");
  99    }
 100  }
 101  
 102  
 103  
 104  
 105  class Google_Service_Webfonts_Webfont extends Google_Collection
 106  {
 107    protected $collection_key = 'variants';
 108    protected $internal_gapi_mappings = array(
 109    );
 110    public $category;
 111    public $family;
 112    public $files;
 113    public $kind;
 114    public $lastModified;
 115    public $subsets;
 116    public $variants;
 117    public $version;
 118  
 119  
 120    public function setCategory($category)
 121    {
 122      $this->category = $category;
 123    }
 124    public function getCategory()
 125    {
 126      return $this->category;
 127    }
 128    public function setFamily($family)
 129    {
 130      $this->family = $family;
 131    }
 132    public function getFamily()
 133    {
 134      return $this->family;
 135    }
 136    public function setFiles($files)
 137    {
 138      $this->files = $files;
 139    }
 140    public function getFiles()
 141    {
 142      return $this->files;
 143    }
 144    public function setKind($kind)
 145    {
 146      $this->kind = $kind;
 147    }
 148    public function getKind()
 149    {
 150      return $this->kind;
 151    }
 152    public function setLastModified($lastModified)
 153    {
 154      $this->lastModified = $lastModified;
 155    }
 156    public function getLastModified()
 157    {
 158      return $this->lastModified;
 159    }
 160    public function setSubsets($subsets)
 161    {
 162      $this->subsets = $subsets;
 163    }
 164    public function getSubsets()
 165    {
 166      return $this->subsets;
 167    }
 168    public function setVariants($variants)
 169    {
 170      $this->variants = $variants;
 171    }
 172    public function getVariants()
 173    {
 174      return $this->variants;
 175    }
 176    public function setVersion($version)
 177    {
 178      $this->version = $version;
 179    }
 180    public function getVersion()
 181    {
 182      return $this->version;
 183    }
 184  }
 185  
 186  class Google_Service_Webfonts_WebfontFiles extends Google_Model
 187  {
 188  }
 189  
 190  class Google_Service_Webfonts_WebfontList extends Google_Collection
 191  {
 192    protected $collection_key = 'items';
 193    protected $internal_gapi_mappings = array(
 194    );
 195    protected $itemsType = 'Google_Service_Webfonts_Webfont';
 196    protected $itemsDataType = 'array';
 197    public $kind;
 198  
 199  
 200    public function setItems($items)
 201    {
 202      $this->items = $items;
 203    }
 204    public function getItems()
 205    {
 206      return $this->items;
 207    }
 208    public function setKind($kind)
 209    {
 210      $this->kind = $kind;
 211    }
 212    public function getKind()
 213    {
 214      return $this->kind;
 215    }
 216  }