wp-database-backup
/
includes
/
admin
/
Destination
/
Google
/
google-api-php-client
/
src
/
contrib
/
Google_WebfontsService.php
Google_WebfontsService.php in WP Database Backup – Unlimited Database & Files Backup by Backup for WP 6.11, at includes/admin/Destination/Google/google-api-php-client/src/contrib/Google_WebfontsService.php
| 1 | <?php |
| 2 | /* |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | * use this file except in compliance with the License. You may obtain a copy of |
| 5 | * the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | * License for the specific language governing permissions and limitations under |
| 13 | * the License. |
| 14 | */ |
| 15 | |
| 16 | |
| 17 | /** |
| 18 | * The "webfonts" collection of methods. |
| 19 | * Typical usage is: |
| 20 | * <code> |
| 21 | * $webfontsService = new Google_WebfontsService(...); |
| 22 | * $webfonts = $webfontsService->webfonts; |
| 23 | * </code> |
| 24 | */ |
| 25 | class Google_WebfontsServiceResource extends Google_ServiceResource { |
| 26 | |
| 27 | /** |
| 28 | * Retrieves the list of fonts currently served by the Google Fonts Developer API (webfonts.list) |
| 29 | * |
| 30 | * @param array $optParams Optional parameters. |
| 31 | * |
| 32 | * @opt_param string sort Enables sorting of the list |
| 33 | * @return Google_WebfontList |
| 34 | */ |
| 35 | public function listWebfonts($optParams = array()) { |
| 36 | $params = array(); |
| 37 | $params = array_merge($params, $optParams); |
| 38 | $data = $this->__call('list', array($params)); |
| 39 | if ($this->useObjects()) { |
| 40 | return new Google_WebfontList($data); |
| 41 | } else { |
| 42 | return $data; |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Service definition for Google_Webfonts (v1). |
| 49 | * |
| 50 | * <p> |
| 51 | * The Google Fonts Developer API. |
| 52 | * </p> |
| 53 | * |
| 54 | * <p> |
| 55 | * For more information about this service, see the |
| 56 | * <a href="https://developers.google.com/fonts/docs/developer_api" target="_blank">API Documentation</a> |
| 57 | * </p> |
| 58 | * |
| 59 | * @author Google, Inc. |
| 60 | */ |
| 61 | class Google_WebfontsService extends Google_Service { |
| 62 | public $webfonts; |
| 63 | /** |
| 64 | * Constructs the internal representation of the Webfonts service. |
| 65 | * |
| 66 | * @param Google_Client $client |
| 67 | */ |
| 68 | public function __construct(Google_Client $client) { |
| 69 | $this->servicePath = 'webfonts/v1/'; |
| 70 | $this->version = 'v1'; |
| 71 | $this->serviceName = 'webfonts'; |
| 72 | |
| 73 | $client->addService($this->serviceName, $this->version); |
| 74 | $this->webfonts = new Google_WebfontsServiceResource($this, $this->serviceName, 'webfonts', json_decode('{"methods": {"list": {"id": "webfonts.webfonts.list", "path": "webfonts", "httpMethod": "GET", "parameters": {"sort": {"type": "string", "enum": ["alpha", "date", "popularity", "style", "trending"], "location": "query"}}, "response": {"$ref": "WebfontList"}}}}', true)); |
| 75 | |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | |
| 80 | |
| 81 | class Google_Webfont extends Google_Model { |
| 82 | public $family; |
| 83 | public $files; |
| 84 | public $kind; |
| 85 | public $lastModified; |
| 86 | public $subsets; |
| 87 | public $variants; |
| 88 | public $version; |
| 89 | public function setFamily( $family) { |
| 90 | $this->family = $family; |
| 91 | } |
| 92 | public function getFamily() { |
| 93 | return $this->family; |
| 94 | } |
| 95 | public function setFiles( $files) { |
| 96 | $this->files = $files; |
| 97 | } |
| 98 | public function getFiles() { |
| 99 | return $this->files; |
| 100 | } |
| 101 | public function setKind( $kind) { |
| 102 | $this->kind = $kind; |
| 103 | } |
| 104 | public function getKind() { |
| 105 | return $this->kind; |
| 106 | } |
| 107 | public function setLastModified( $lastModified) { |
| 108 | $this->lastModified = $lastModified; |
| 109 | } |
| 110 | public function getLastModified() { |
| 111 | return $this->lastModified; |
| 112 | } |
| 113 | public function setSubsets(/* array(Google_string) */ $subsets) { |
| 114 | $this->assertIsArray($subsets, 'Google_string', __METHOD__); |
| 115 | $this->subsets = $subsets; |
| 116 | } |
| 117 | public function getSubsets() { |
| 118 | return $this->subsets; |
| 119 | } |
| 120 | public function setVariants(/* array(Google_string) */ $variants) { |
| 121 | $this->assertIsArray($variants, 'Google_string', __METHOD__); |
| 122 | $this->variants = $variants; |
| 123 | } |
| 124 | public function getVariants() { |
| 125 | return $this->variants; |
| 126 | } |
| 127 | public function setVersion( $version) { |
| 128 | $this->version = $version; |
| 129 | } |
| 130 | public function getVersion() { |
| 131 | return $this->version; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | class Google_WebfontList extends Google_Model { |
| 136 | protected $__itemsType = 'Google_Webfont'; |
| 137 | protected $__itemsDataType = 'array'; |
| 138 | public $items; |
| 139 | public $kind; |
| 140 | public function setItems(/* array(Google_Webfont) */ $items) { |
| 141 | $this->assertIsArray($items, 'Google_Webfont', __METHOD__); |
| 142 | $this->items = $items; |
| 143 | } |
| 144 | public function getItems() { |
| 145 | return $this->items; |
| 146 | } |
| 147 | public function setKind( $kind) { |
| 148 | $this->kind = $kind; |
| 149 | } |
| 150 | public function getKind() { |
| 151 | return $this->kind; |
| 152 | } |
| 153 | } |
| 154 |