ApiKeysService.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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 ApiKeysService (v2).
  21. *
  22. * <p>
  23. * Manages the API keys associated with developer projects.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/api-keys/docs" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class ApiKeysService extends \Google\Service
  33. {
  34. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  35. const CLOUD_PLATFORM =
  36. "https://www.googleapis.com/auth/cloud-platform";
  37. /** View your data across Google Cloud services and see the email address of your Google Account. */
  38. const CLOUD_PLATFORM_READ_ONLY =
  39. "https://www.googleapis.com/auth/cloud-platform.read-only";
  40. public $keys;
  41. public $operations;
  42. public $projects_locations_keys;
  43. public $rootUrlTemplate;
  44. /**
  45. * Constructs the internal representation of the ApiKeysService service.
  46. *
  47. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  48. * config array to pass to a new Client instance.
  49. * @param string $rootUrl The root URL used for requests to the service.
  50. */
  51. public function __construct($clientOrConfig = [], $rootUrl = null)
  52. {
  53. parent::__construct($clientOrConfig);
  54. $this->rootUrl = $rootUrl ?: 'https://apikeys.googleapis.com/';
  55. $this->rootUrlTemplate = $rootUrl ?: 'https://apikeys.UNIVERSE_DOMAIN/';
  56. $this->servicePath = '';
  57. $this->batchPath = 'batch';
  58. $this->version = 'v2';
  59. $this->serviceName = 'apikeys';
  60. $this->keys = new ApiKeysService\Resource\Keys(
  61. $this,
  62. $this->serviceName,
  63. 'keys',
  64. [
  65. 'methods' => [
  66. 'lookupKey' => [
  67. 'path' => 'v2/keys:lookupKey',
  68. 'httpMethod' => 'GET',
  69. 'parameters' => [
  70. 'keyString' => [
  71. 'location' => 'query',
  72. 'type' => 'string',
  73. ],
  74. ],
  75. ],
  76. ]
  77. ]
  78. );
  79. $this->operations = new ApiKeysService\Resource\Operations(
  80. $this,
  81. $this->serviceName,
  82. 'operations',
  83. [
  84. 'methods' => [
  85. 'get' => [
  86. 'path' => 'v2/{+name}',
  87. 'httpMethod' => 'GET',
  88. 'parameters' => [
  89. 'name' => [
  90. 'location' => 'path',
  91. 'type' => 'string',
  92. 'required' => true,
  93. ],
  94. ],
  95. ],
  96. ]
  97. ]
  98. );
  99. $this->projects_locations_keys = new ApiKeysService\Resource\ProjectsLocationsKeys(
  100. $this,
  101. $this->serviceName,
  102. 'keys',
  103. [
  104. 'methods' => [
  105. 'create' => [
  106. 'path' => 'v2/{+parent}/keys',
  107. 'httpMethod' => 'POST',
  108. 'parameters' => [
  109. 'parent' => [
  110. 'location' => 'path',
  111. 'type' => 'string',
  112. 'required' => true,
  113. ],
  114. 'keyId' => [
  115. 'location' => 'query',
  116. 'type' => 'string',
  117. ],
  118. ],
  119. ],'delete' => [
  120. 'path' => 'v2/{+name}',
  121. 'httpMethod' => 'DELETE',
  122. 'parameters' => [
  123. 'name' => [
  124. 'location' => 'path',
  125. 'type' => 'string',
  126. 'required' => true,
  127. ],
  128. 'etag' => [
  129. 'location' => 'query',
  130. 'type' => 'string',
  131. ],
  132. ],
  133. ],'get' => [
  134. 'path' => 'v2/{+name}',
  135. 'httpMethod' => 'GET',
  136. 'parameters' => [
  137. 'name' => [
  138. 'location' => 'path',
  139. 'type' => 'string',
  140. 'required' => true,
  141. ],
  142. ],
  143. ],'getKeyString' => [
  144. 'path' => 'v2/{+name}/keyString',
  145. 'httpMethod' => 'GET',
  146. 'parameters' => [
  147. 'name' => [
  148. 'location' => 'path',
  149. 'type' => 'string',
  150. 'required' => true,
  151. ],
  152. ],
  153. ],'list' => [
  154. 'path' => 'v2/{+parent}/keys',
  155. 'httpMethod' => 'GET',
  156. 'parameters' => [
  157. 'parent' => [
  158. 'location' => 'path',
  159. 'type' => 'string',
  160. 'required' => true,
  161. ],
  162. 'pageSize' => [
  163. 'location' => 'query',
  164. 'type' => 'integer',
  165. ],
  166. 'pageToken' => [
  167. 'location' => 'query',
  168. 'type' => 'string',
  169. ],
  170. 'showDeleted' => [
  171. 'location' => 'query',
  172. 'type' => 'boolean',
  173. ],
  174. ],
  175. ],'patch' => [
  176. 'path' => 'v2/{+name}',
  177. 'httpMethod' => 'PATCH',
  178. 'parameters' => [
  179. 'name' => [
  180. 'location' => 'path',
  181. 'type' => 'string',
  182. 'required' => true,
  183. ],
  184. 'updateMask' => [
  185. 'location' => 'query',
  186. 'type' => 'string',
  187. ],
  188. ],
  189. ],'undelete' => [
  190. 'path' => 'v2/{+name}:undelete',
  191. 'httpMethod' => 'POST',
  192. 'parameters' => [
  193. 'name' => [
  194. 'location' => 'path',
  195. 'type' => 'string',
  196. 'required' => true,
  197. ],
  198. ],
  199. ],
  200. ]
  201. ]
  202. );
  203. }
  204. }
  205. // Adding a class alias for backwards compatibility with the previous class name.
  206. class_alias(ApiKeysService::class, 'Google_Service_ApiKeysService');