Indexing.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 Indexing (v3).
  21. *
  22. * <p>
  23. * Notifies Google Web Search when your web pages change.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://developers.google.com/search/apis/indexing-api/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class Indexing extends \Google\Service
  33. {
  34. /** Submit data to Google for indexing. */
  35. const INDEXING =
  36. "https://www.googleapis.com/auth/indexing";
  37. public $urlNotifications;
  38. public $rootUrlTemplate;
  39. /**
  40. * Constructs the internal representation of the Indexing service.
  41. *
  42. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  43. * config array to pass to a new Client instance.
  44. * @param string $rootUrl The root URL used for requests to the service.
  45. */
  46. public function __construct($clientOrConfig = [], $rootUrl = null)
  47. {
  48. parent::__construct($clientOrConfig);
  49. $this->rootUrl = $rootUrl ?: 'https://indexing.googleapis.com/';
  50. $this->rootUrlTemplate = $rootUrl ?: 'https://indexing.UNIVERSE_DOMAIN/';
  51. $this->servicePath = '';
  52. $this->batchPath = 'batch';
  53. $this->version = 'v3';
  54. $this->serviceName = 'indexing';
  55. $this->urlNotifications = new Indexing\Resource\UrlNotifications(
  56. $this,
  57. $this->serviceName,
  58. 'urlNotifications',
  59. [
  60. 'methods' => [
  61. 'getMetadata' => [
  62. 'path' => 'v3/urlNotifications/metadata',
  63. 'httpMethod' => 'GET',
  64. 'parameters' => [
  65. 'url' => [
  66. 'location' => 'query',
  67. 'type' => 'string',
  68. ],
  69. ],
  70. ],'publish' => [
  71. 'path' => 'v3/urlNotifications:publish',
  72. 'httpMethod' => 'POST',
  73. 'parameters' => [],
  74. ],
  75. ]
  76. ]
  77. );
  78. }
  79. }
  80. // Adding a class alias for backwards compatibility with the previous class name.
  81. class_alias(Indexing::class, 'Google_Service_Indexing');