Kgsearch.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /*
  3. * Copyright 2014 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. namespace Google\Service;
  18. use Google\Client;
  19. /**
  20. * Service definition for Kgsearch (v1).
  21. *
  22. * <p>
  23. * Searches the Google Knowledge Graph for entities.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://developers.google.com/knowledge-graph/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class Kgsearch extends \Google\Service
  33. {
  34. public $entities;
  35. /**
  36. * Constructs the internal representation of the Kgsearch service.
  37. *
  38. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  39. * config array to pass to a new Client instance.
  40. * @param string $rootUrl The root URL used for requests to the service.
  41. */
  42. public function __construct($clientOrConfig = [], $rootUrl = null)
  43. {
  44. parent::__construct($clientOrConfig);
  45. $this->rootUrl = $rootUrl ?: 'https://kgsearch.googleapis.com/';
  46. $this->servicePath = '';
  47. $this->batchPath = 'batch';
  48. $this->version = 'v1';
  49. $this->serviceName = 'kgsearch';
  50. $this->entities = new Kgsearch\Resource\Entities(
  51. $this,
  52. $this->serviceName,
  53. 'entities',
  54. [
  55. 'methods' => [
  56. 'search' => [
  57. 'path' => 'v1/entities:search',
  58. 'httpMethod' => 'GET',
  59. 'parameters' => [
  60. 'ids' => [
  61. 'location' => 'query',
  62. 'type' => 'string',
  63. 'repeated' => true,
  64. ],
  65. 'indent' => [
  66. 'location' => 'query',
  67. 'type' => 'boolean',
  68. ],
  69. 'languages' => [
  70. 'location' => 'query',
  71. 'type' => 'string',
  72. 'repeated' => true,
  73. ],
  74. 'limit' => [
  75. 'location' => 'query',
  76. 'type' => 'integer',
  77. ],
  78. 'prefix' => [
  79. 'location' => 'query',
  80. 'type' => 'boolean',
  81. ],
  82. 'query' => [
  83. 'location' => 'query',
  84. 'type' => 'string',
  85. ],
  86. 'types' => [
  87. 'location' => 'query',
  88. 'type' => 'string',
  89. 'repeated' => true,
  90. ],
  91. ],
  92. ],
  93. ]
  94. ]
  95. );
  96. }
  97. }
  98. // Adding a class alias for backwards compatibility with the previous class name.
  99. class_alias(Kgsearch::class, 'Google_Service_Kgsearch');