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