SiteVerification.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 SiteVerification (v1).
  21. *
  22. * <p>
  23. * Verifies ownership of websites or domains with Google.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://developers.google.com/site-verification/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class SiteVerification extends \Google\Service
  33. {
  34. /** Manage the list of sites and domains you control. */
  35. const SITEVERIFICATION =
  36. "https://www.googleapis.com/auth/siteverification";
  37. /** Manage your new site verifications with Google. */
  38. const SITEVERIFICATION_VERIFY_ONLY =
  39. "https://www.googleapis.com/auth/siteverification.verify_only";
  40. public $webResource;
  41. public $rootUrlTemplate;
  42. /**
  43. * Constructs the internal representation of the SiteVerification service.
  44. *
  45. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  46. * config array to pass to a new Client instance.
  47. * @param string $rootUrl The root URL used for requests to the service.
  48. */
  49. public function __construct($clientOrConfig = [], $rootUrl = null)
  50. {
  51. parent::__construct($clientOrConfig);
  52. $this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/';
  53. $this->rootUrlTemplate = $rootUrl ?: 'https://www.UNIVERSE_DOMAIN/';
  54. $this->servicePath = 'siteVerification/v1/';
  55. $this->batchPath = 'batch/siteVerification/v1';
  56. $this->version = 'v1';
  57. $this->serviceName = 'siteVerification';
  58. $this->webResource = new SiteVerification\Resource\WebResource(
  59. $this,
  60. $this->serviceName,
  61. 'webResource',
  62. [
  63. 'methods' => [
  64. 'delete' => [
  65. 'path' => 'webResource/{id}',
  66. 'httpMethod' => 'DELETE',
  67. 'parameters' => [
  68. 'id' => [
  69. 'location' => 'path',
  70. 'type' => 'string',
  71. 'required' => true,
  72. ],
  73. ],
  74. ],'get' => [
  75. 'path' => 'webResource/{id}',
  76. 'httpMethod' => 'GET',
  77. 'parameters' => [
  78. 'id' => [
  79. 'location' => 'path',
  80. 'type' => 'string',
  81. 'required' => true,
  82. ],
  83. ],
  84. ],'getToken' => [
  85. 'path' => 'token',
  86. 'httpMethod' => 'POST',
  87. 'parameters' => [],
  88. ],'insert' => [
  89. 'path' => 'webResource',
  90. 'httpMethod' => 'POST',
  91. 'parameters' => [
  92. 'verificationMethod' => [
  93. 'location' => 'query',
  94. 'type' => 'string',
  95. 'required' => true,
  96. ],
  97. ],
  98. ],'list' => [
  99. 'path' => 'webResource',
  100. 'httpMethod' => 'GET',
  101. 'parameters' => [],
  102. ],'patch' => [
  103. 'path' => 'webResource/{id}',
  104. 'httpMethod' => 'PATCH',
  105. 'parameters' => [
  106. 'id' => [
  107. 'location' => 'path',
  108. 'type' => 'string',
  109. 'required' => true,
  110. ],
  111. ],
  112. ],'update' => [
  113. 'path' => 'webResource/{id}',
  114. 'httpMethod' => 'PUT',
  115. 'parameters' => [
  116. 'id' => [
  117. 'location' => 'path',
  118. 'type' => 'string',
  119. 'required' => true,
  120. ],
  121. ],
  122. ],
  123. ]
  124. ]
  125. );
  126. }
  127. }
  128. // Adding a class alias for backwards compatibility with the previous class name.
  129. class_alias(SiteVerification::class, 'Google_Service_SiteVerification');