/vendor/venne/googleanalytics-module/src/contrib/Google_WebfontsService.php

https://bitbucket.org/iiic/iszp · PHP · 130 lines · 72 code · 9 blank · 49 comment · 2 complexity · 04260525d97d2a1701821eced43fd96e MD5 · raw file

  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. * The "webfonts" collection of methods.
  17. * Typical usage is:
  18. * <code>
  19. * $webfontsService = new Google_WebfontsService(...);
  20. * $webfonts = $webfontsService->webfonts;
  21. * </code>
  22. */
  23. class Google_WebfontsServiceResource extends Google_ServiceResource {
  24. /**
  25. * Retrieves the list of fonts currently served by the Google Web Fonts Developer API
  26. * (webfonts.list)
  27. *
  28. * @param array $optParams Optional parameters.
  29. *
  30. * @opt_param string sort Enables sorting of the list
  31. * @return Google_WebfontList
  32. */
  33. public function listWebfonts($optParams = array()) {
  34. $params = array();
  35. $params = array_merge($params, $optParams);
  36. $data = $this->__call('list', array($params));
  37. if ($this->useObjects()) {
  38. return new Google_WebfontList($data);
  39. } else {
  40. return $data;
  41. }
  42. }
  43. }
  44. /**
  45. * Service definition for Google_Webfonts (v1).
  46. *
  47. * <p>
  48. * The Google Web Fonts Developer API.
  49. * </p>
  50. *
  51. * <p>
  52. * For more information about this service, see the
  53. * <a href="http://code.google.com/apis/webfonts/docs/developer_api.html" target="_blank">API Documentation</a>
  54. * </p>
  55. *
  56. * @author Google, Inc.
  57. */
  58. class Google_WebfontsService extends Google_Service {
  59. public $webfonts;
  60. /**
  61. * Constructs the internal representation of the Webfonts service.
  62. *
  63. * @param Google_Client $client
  64. */
  65. public function __construct(Google_Client $client) {
  66. $this->servicePath = 'webfonts/v1/';
  67. $this->version = 'v1';
  68. $this->serviceName = 'webfonts';
  69. $client->addService($this->serviceName, $this->version);
  70. $this->webfonts = new Google_WebfontsServiceResource($this, $this->serviceName, 'webfonts', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "WebfontList"}, "id": "webfonts.webfonts.list", "parameters": {"sort": {"enum": ["alpha", "date", "popularity", "style", "trending"], "type": "string", "location": "query"}}, "path": "webfonts"}}}', true));
  71. }
  72. }
  73. class Google_Webfont extends Google_Model {
  74. public $kind;
  75. public $variants;
  76. public $subsets;
  77. public $family;
  78. public function setKind($kind) {
  79. $this->kind = $kind;
  80. }
  81. public function getKind() {
  82. return $this->kind;
  83. }
  84. public function setVariants($variants) {
  85. $this->variants = $variants;
  86. }
  87. public function getVariants() {
  88. return $this->variants;
  89. }
  90. public function setSubsets($subsets) {
  91. $this->subsets = $subsets;
  92. }
  93. public function getSubsets() {
  94. return $this->subsets;
  95. }
  96. public function setFamily($family) {
  97. $this->family = $family;
  98. }
  99. public function getFamily() {
  100. return $this->family;
  101. }
  102. }
  103. class Google_WebfontList extends Google_Model {
  104. protected $__itemsType = 'Google_Webfont';
  105. protected $__itemsDataType = 'array';
  106. public $items;
  107. public $kind;
  108. public function setItems(/* array(Google_Webfont) */ $items) {
  109. $this->assertIsArray($items, 'Google_Webfont', __METHOD__);
  110. $this->items = $items;
  111. }
  112. public function getItems() {
  113. return $this->items;
  114. }
  115. public function setKind($kind) {
  116. $this->kind = $kind;
  117. }
  118. public function getKind() {
  119. return $this->kind;
  120. }
  121. }