ServiceUsage.php 7.2 KB

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