PageRenderTime 33ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/google-analyticator/google-api-php-client/src/contrib/Google_FreebaseService.php

https://github.com/AJenbo/ubuntudanmark.dk
PHP | 388 lines | 297 code | 20 blank | 71 comment | 4 complexity | e0e5ade743fd102bd9c057014fb2d397 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 "text" collection of methods.
  17. * Typical usage is:
  18. * <code>
  19. * $freebaseService = new Google_FreebaseService(...);
  20. * $text = $freebaseService->text;
  21. * </code>
  22. */
  23. class Google_TextServiceResource extends Google_ServiceResource {
  24. /**
  25. * Returns blob attached to node at specified id as HTML (text.get)
  26. *
  27. * @param string $id The id of the item that you want data about
  28. * @param array $optParams Optional parameters.
  29. *
  30. * @opt_param string format Sanitizing transformation.
  31. * @opt_param string maxlength The max number of characters to return. Valid only for 'plain' format.
  32. * @return Google_ContentserviceGet
  33. */
  34. public function get($id, $optParams = array()) {
  35. $params = array('id' => $id);
  36. $params = array_merge($params, $optParams);
  37. $data = $this->__call('get', array($params));
  38. if ($this->useObjects()) {
  39. return new Google_ContentserviceGet($data);
  40. } else {
  41. return $data;
  42. }
  43. }
  44. }
  45. /**
  46. * The "topic" collection of methods.
  47. * Typical usage is:
  48. * <code>
  49. * $freebaseService = new Google_FreebaseService(...);
  50. * $topic = $freebaseService->topic;
  51. * </code>
  52. */
  53. class Google_TopicServiceResource extends Google_ServiceResource {
  54. /**
  55. * Get properties and meta-data about a topic. (topic.lookup)
  56. *
  57. * @param string $id The id of the item that you want data about.
  58. * @param array $optParams Optional parameters.
  59. *
  60. * @opt_param string dateline Determines how up-to-date the data returned is. A unix epoch time, a guid or a 'now'
  61. * @opt_param string filter A frebase domain, type or property id, 'suggest', 'commons', or 'all'. Filter the results and returns only appropriate properties.
  62. * @opt_param string lang The language you 'd like the content in - a freebase /type/lang language key.
  63. * @opt_param string limit The maximum number of property values to return for each property.
  64. * @opt_param bool raw Do not apply any constraints, or get any names.
  65. * @return Google_TopicLookup
  66. */
  67. public function lookup($id, $optParams = array()) {
  68. $params = array('id' => $id);
  69. $params = array_merge($params, $optParams);
  70. $data = $this->__call('lookup', array($params));
  71. if ($this->useObjects()) {
  72. return new Google_TopicLookup($data);
  73. } else {
  74. return $data;
  75. }
  76. }
  77. }
  78. /**
  79. * Service definition for Google_Freebase (v1).
  80. *
  81. * <p>
  82. * Topic and MQL APIs provide you structured access to Freebase data.
  83. * </p>
  84. *
  85. * <p>
  86. * For more information about this service, see the
  87. * <a href="https://developers.google.com/freebase/" target="_blank">API Documentation</a>
  88. * </p>
  89. *
  90. * @author Google, Inc.
  91. */
  92. class Google_FreebaseService extends Google_Service {
  93. public $text;
  94. public $topic;
  95. /**
  96. * Constructs the internal representation of the Freebase service.
  97. *
  98. * @param Google_Client $client
  99. */
  100. public function __construct(Google_Client $client) {
  101. $this->servicePath = 'freebase/v1/';
  102. $this->version = 'v1';
  103. $this->serviceName = 'freebase';
  104. $client->addService($this->serviceName, $this->version);
  105. $this->text = new Google_TextServiceResource($this, $this->serviceName, 'text', json_decode('{"methods": {"get": {"id": "freebase.text.get", "path": "text{/id*}", "httpMethod": "GET", "parameters": {"format": {"type": "string", "default": "plain", "enum": ["html", "plain", "raw"], "location": "query"}, "id": {"type": "string", "required": true, "repeated": true, "location": "path"}, "maxlength": {"type": "integer", "format": "uint32", "location": "query"}}, "response": {"$ref": "ContentserviceGet"}}}}', true));
  106. $this->topic = new Google_TopicServiceResource($this, $this->serviceName, 'topic', json_decode('{"methods": {"lookup": {"id": "freebase.topic.lookup", "path": "topic{/id*}", "httpMethod": "GET", "parameters": {"dateline": {"type": "string", "location": "query"}, "filter": {"type": "string", "repeated": true, "location": "query"}, "id": {"type": "string", "required": true, "repeated": true, "location": "path"}, "lang": {"type": "string", "default": "en", "location": "query"}, "limit": {"type": "integer", "default": "10", "format": "uint32", "location": "query"}, "raw": {"type": "boolean", "default": "false", "location": "query"}}, "response": {"$ref": "TopicLookup"}}}}', true));
  107. $this->image = new Google_ImageServiceResource($this, $this->serviceName, 'image', json_decode('{"httpMethod": "GET", "path": "image{/id*}", "supportsMediaDownload": true, "id": "freebase.image", "parameters": {"fallbackid": {"type": "string", "default": "/freebase/no_image_png", "location": "query"}, "id": {"type": "string", "required": true, "repeated": true, "location": "path"}, "maxheight": {"type": "integer", "format": "uint32", "maximum": "4096", "location": "query"}, "maxwidth": {"type": "integer", "format": "uint32", "maximum": "4096", "location": "query"}, "mode": {"type": "string", "default": "fit", "enum": ["fill", "fillcrop", "fillcropmid", "fit"], "location": "query"}, "pad": {"type": "boolean", "default": "false", "location": "query"}}}', true));
  108. $this->mqlread = new Google_MqlreadServiceResource($this, $this->serviceName, 'mqlread', json_decode('{"httpMethod": "GET", "path": "mqlread", "supportsMediaDownload": true, "id": "freebase.mqlread", "parameters": {"as_of_time": {"type": "string", "location": "query"}, "callback": {"type": "string", "location": "query"}, "cost": {"type": "boolean", "default": "false", "location": "query"}, "cursor": {"type": "string", "location": "query"}, "dateline": {"type": "string", "location": "query"}, "html_escape": {"type": "boolean", "default": "true", "location": "query"}, "indent": {"type": "integer", "default": "0", "format": "uint32", "maximum": "10", "location": "query"}, "lang": {"type": "string", "default": "/lang/en", "location": "query"}, "query": {"type": "string", "required": true, "location": "query"}, "uniqueness_failure": {"type": "string", "default": "hard", "enum": ["hard", "soft"], "location": "query"}}}', true));
  109. $this->mqlwrite = new Google_MqlwriteServiceResource($this, $this->serviceName, 'mqlwrite', json_decode('{"httpMethod": "GET", "path": "mqlwrite", "scopes": ["https://www.googleapis.com/auth/freebase"], "supportsMediaDownload": true, "id": "freebase.mqlwrite", "parameters": {"callback": {"type": "string", "location": "query"}, "dateline": {"type": "string", "location": "query"}, "indent": {"type": "integer", "default": "0", "format": "uint32", "maximum": "10", "location": "query"}, "query": {"type": "string", "required": true, "location": "query"}, "use_permission_of": {"type": "string", "location": "query"}}}', true));
  110. }
  111. }
  112. class Google_ContentserviceGet extends Google_Model {
  113. public $result;
  114. public function setResult( $result) {
  115. $this->result = $result;
  116. }
  117. public function getResult() {
  118. return $this->result;
  119. }
  120. }
  121. class Google_TopicLookup extends Google_Model {
  122. public $id;
  123. protected $__propertyType = 'Google_TopicLookupProperty';
  124. protected $__propertyDataType = '';
  125. public $property;
  126. public function setId( $id) {
  127. $this->id = $id;
  128. }
  129. public function getId() {
  130. return $this->id;
  131. }
  132. public function setProperty(Google_TopicLookupProperty $property) {
  133. $this->property = $property;
  134. }
  135. public function getProperty() {
  136. return $this->property;
  137. }
  138. }
  139. class Google_TopicLookupProperty extends Google_Model {
  140. protected $___freebase_object_profile_linkcountType = 'Google_TopicStatslinkcount';
  141. protected $___freebase_object_profile_linkcountDataType = '';
  142. public $_freebase_object_profile_linkcount;
  143. public function set_freebase_object_profile_linkcount(Google_TopicStatslinkcount $_freebase_object_profile_linkcount) {
  144. $this->_freebase_object_profile_linkcount = $_freebase_object_profile_linkcount;
  145. }
  146. public function get_freebase_object_profile_linkcount() {
  147. return $this->_freebase_object_profile_linkcount;
  148. }
  149. }
  150. class Google_TopicPropertyvalue extends Google_Model {
  151. public $count;
  152. public $status;
  153. protected $__valuesType = 'Google_TopicValue';
  154. protected $__valuesDataType = 'array';
  155. public $values;
  156. public $valuetype;
  157. public function setCount( $count) {
  158. $this->count = $count;
  159. }
  160. public function getCount() {
  161. return $this->count;
  162. }
  163. public function setStatus( $status) {
  164. $this->status = $status;
  165. }
  166. public function getStatus() {
  167. return $this->status;
  168. }
  169. public function setValues(/* array(Google_TopicValue) */ $values) {
  170. $this->assertIsArray($values, 'Google_TopicValue', __METHOD__);
  171. $this->values = $values;
  172. }
  173. public function getValues() {
  174. return $this->values;
  175. }
  176. public function setValuetype( $valuetype) {
  177. $this->valuetype = $valuetype;
  178. }
  179. public function getValuetype() {
  180. return $this->valuetype;
  181. }
  182. }
  183. class Google_TopicStatslinkcount extends Google_Model {
  184. public $type;
  185. protected $__valuesType = 'Google_TopicStatslinkcountValues';
  186. protected $__valuesDataType = 'array';
  187. public $values;
  188. public function setType( $type) {
  189. $this->type = $type;
  190. }
  191. public function getType() {
  192. return $this->type;
  193. }
  194. public function setValues(/* array(Google_TopicStatslinkcountValues) */ $values) {
  195. $this->assertIsArray($values, 'Google_TopicStatslinkcountValues', __METHOD__);
  196. $this->values = $values;
  197. }
  198. public function getValues() {
  199. return $this->values;
  200. }
  201. }
  202. class Google_TopicStatslinkcountValues extends Google_Model {
  203. public $count;
  204. public $id;
  205. protected $__valuesType = 'Google_TopicStatslinkcountValuesValues';
  206. protected $__valuesDataType = 'array';
  207. public $values;
  208. public function setCount( $count) {
  209. $this->count = $count;
  210. }
  211. public function getCount() {
  212. return $this->count;
  213. }
  214. public function setId( $id) {
  215. $this->id = $id;
  216. }
  217. public function getId() {
  218. return $this->id;
  219. }
  220. public function setValues(/* array(Google_TopicStatslinkcountValuesValues) */ $values) {
  221. $this->assertIsArray($values, 'Google_TopicStatslinkcountValuesValues', __METHOD__);
  222. $this->values = $values;
  223. }
  224. public function getValues() {
  225. return $this->values;
  226. }
  227. }
  228. class Google_TopicStatslinkcountValuesValues extends Google_Model {
  229. public $count;
  230. public $id;
  231. protected $__valuesType = 'Google_TopicStatslinkcountValuesValuesValues';
  232. protected $__valuesDataType = 'array';
  233. public $values;
  234. public function setCount( $count) {
  235. $this->count = $count;
  236. }
  237. public function getCount() {
  238. return $this->count;
  239. }
  240. public function setId( $id) {
  241. $this->id = $id;
  242. }
  243. public function getId() {
  244. return $this->id;
  245. }
  246. public function setValues(/* array(Google_TopicStatslinkcountValuesValuesValues) */ $values) {
  247. $this->assertIsArray($values, 'Google_TopicStatslinkcountValuesValuesValues', __METHOD__);
  248. $this->values = $values;
  249. }
  250. public function getValues() {
  251. return $this->values;
  252. }
  253. }
  254. class Google_TopicStatslinkcountValuesValuesValues extends Google_Model {
  255. public $count;
  256. public $id;
  257. public function setCount( $count) {
  258. $this->count = $count;
  259. }
  260. public function getCount() {
  261. return $this->count;
  262. }
  263. public function setId( $id) {
  264. $this->id = $id;
  265. }
  266. public function getId() {
  267. return $this->id;
  268. }
  269. }
  270. class Google_TopicValue extends Google_Model {
  271. protected $__citationType = 'Google_TopicValueCitation';
  272. protected $__citationDataType = '';
  273. public $citation;
  274. public $creator;
  275. public $dataset;
  276. public $id;
  277. public $lang;
  278. public $project;
  279. protected $__propertyType = 'Google_TopicPropertyvalue';
  280. protected $__propertyDataType = 'map';
  281. public $property;
  282. public $text;
  283. public $timestamp;
  284. public $value;
  285. public function setCitation(Google_TopicValueCitation $citation) {
  286. $this->citation = $citation;
  287. }
  288. public function getCitation() {
  289. return $this->citation;
  290. }
  291. public function setCreator( $creator) {
  292. $this->creator = $creator;
  293. }
  294. public function getCreator() {
  295. return $this->creator;
  296. }
  297. public function setDataset( $dataset) {
  298. $this->dataset = $dataset;
  299. }
  300. public function getDataset() {
  301. return $this->dataset;
  302. }
  303. public function setId( $id) {
  304. $this->id = $id;
  305. }
  306. public function getId() {
  307. return $this->id;
  308. }
  309. public function setLang( $lang) {
  310. $this->lang = $lang;
  311. }
  312. public function getLang() {
  313. return $this->lang;
  314. }
  315. public function setProject( $project) {
  316. $this->project = $project;
  317. }
  318. public function getProject() {
  319. return $this->project;
  320. }
  321. public function setProperty(Google_TopicPropertyvalue $property) {
  322. $this->property = $property;
  323. }
  324. public function getProperty() {
  325. return $this->property;
  326. }
  327. public function setText( $text) {
  328. $this->text = $text;
  329. }
  330. public function getText() {
  331. return $this->text;
  332. }
  333. public function setTimestamp( $timestamp) {
  334. $this->timestamp = $timestamp;
  335. }
  336. public function getTimestamp() {
  337. return $this->timestamp;
  338. }
  339. public function setValue( $value) {
  340. $this->value = $value;
  341. }
  342. public function getValue() {
  343. return $this->value;
  344. }
  345. }
  346. class Google_TopicValueCitation extends Google_Model {
  347. public $provider;
  348. public $statement;
  349. public $uri;
  350. public function setProvider( $provider) {
  351. $this->provider = $provider;
  352. }
  353. public function getProvider() {
  354. return $this->provider;
  355. }
  356. public function setStatement( $statement) {
  357. $this->statement = $statement;
  358. }
  359. public function getStatement() {
  360. return $this->statement;
  361. }
  362. public function setUri( $uri) {
  363. $this->uri = $uri;
  364. }
  365. public function getUri() {
  366. return $this->uri;
  367. }
  368. }