Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

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