Cloudbilling.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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 Cloudbilling (v1).
  21. *
  22. * <p>
  23. * Allows developers to manage billing for their Google Cloud Platform projects
  24. * programmatically.</p>
  25. *
  26. * <p>
  27. * For more information about this service, see the API
  28. * <a href="https://cloud.google.com/billing/" target="_blank">Documentation</a>
  29. * </p>
  30. *
  31. * @author Google, Inc.
  32. */
  33. class Cloudbilling extends \Google\Service
  34. {
  35. /** View and manage your Google Cloud Platform billing accounts. */
  36. const CLOUD_BILLING =
  37. "https://www.googleapis.com/auth/cloud-billing";
  38. /** View your Google Cloud Platform billing accounts. */
  39. const CLOUD_BILLING_READONLY =
  40. "https://www.googleapis.com/auth/cloud-billing.readonly";
  41. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  42. const CLOUD_PLATFORM =
  43. "https://www.googleapis.com/auth/cloud-platform";
  44. public $billingAccounts;
  45. public $billingAccounts_projects;
  46. public $projects;
  47. public $services;
  48. public $services_skus;
  49. /**
  50. * Constructs the internal representation of the Cloudbilling service.
  51. *
  52. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  53. * config array to pass to a new Client instance.
  54. * @param string $rootUrl The root URL used for requests to the service.
  55. */
  56. public function __construct($clientOrConfig = [], $rootUrl = null)
  57. {
  58. parent::__construct($clientOrConfig);
  59. $this->rootUrl = $rootUrl ?: 'https://cloudbilling.googleapis.com/';
  60. $this->servicePath = '';
  61. $this->batchPath = 'batch';
  62. $this->version = 'v1';
  63. $this->serviceName = 'cloudbilling';
  64. $this->billingAccounts = new Cloudbilling\Resource\BillingAccounts(
  65. $this,
  66. $this->serviceName,
  67. 'billingAccounts',
  68. [
  69. 'methods' => [
  70. 'create' => [
  71. 'path' => 'v1/billingAccounts',
  72. 'httpMethod' => 'POST',
  73. 'parameters' => [],
  74. ],'get' => [
  75. 'path' => 'v1/{+name}',
  76. 'httpMethod' => 'GET',
  77. 'parameters' => [
  78. 'name' => [
  79. 'location' => 'path',
  80. 'type' => 'string',
  81. 'required' => true,
  82. ],
  83. ],
  84. ],'getIamPolicy' => [
  85. 'path' => 'v1/{+resource}:getIamPolicy',
  86. 'httpMethod' => 'GET',
  87. 'parameters' => [
  88. 'resource' => [
  89. 'location' => 'path',
  90. 'type' => 'string',
  91. 'required' => true,
  92. ],
  93. 'options.requestedPolicyVersion' => [
  94. 'location' => 'query',
  95. 'type' => 'integer',
  96. ],
  97. ],
  98. ],'list' => [
  99. 'path' => 'v1/billingAccounts',
  100. 'httpMethod' => 'GET',
  101. 'parameters' => [
  102. 'filter' => [
  103. 'location' => 'query',
  104. 'type' => 'string',
  105. ],
  106. 'pageSize' => [
  107. 'location' => 'query',
  108. 'type' => 'integer',
  109. ],
  110. 'pageToken' => [
  111. 'location' => 'query',
  112. 'type' => 'string',
  113. ],
  114. ],
  115. ],'patch' => [
  116. 'path' => 'v1/{+name}',
  117. 'httpMethod' => 'PATCH',
  118. 'parameters' => [
  119. 'name' => [
  120. 'location' => 'path',
  121. 'type' => 'string',
  122. 'required' => true,
  123. ],
  124. 'updateMask' => [
  125. 'location' => 'query',
  126. 'type' => 'string',
  127. ],
  128. ],
  129. ],'setIamPolicy' => [
  130. 'path' => 'v1/{+resource}:setIamPolicy',
  131. 'httpMethod' => 'POST',
  132. 'parameters' => [
  133. 'resource' => [
  134. 'location' => 'path',
  135. 'type' => 'string',
  136. 'required' => true,
  137. ],
  138. ],
  139. ],'testIamPermissions' => [
  140. 'path' => 'v1/{+resource}:testIamPermissions',
  141. 'httpMethod' => 'POST',
  142. 'parameters' => [
  143. 'resource' => [
  144. 'location' => 'path',
  145. 'type' => 'string',
  146. 'required' => true,
  147. ],
  148. ],
  149. ],
  150. ]
  151. ]
  152. );
  153. $this->billingAccounts_projects = new Cloudbilling\Resource\BillingAccountsProjects(
  154. $this,
  155. $this->serviceName,
  156. 'projects',
  157. [
  158. 'methods' => [
  159. 'list' => [
  160. 'path' => 'v1/{+name}/projects',
  161. 'httpMethod' => 'GET',
  162. 'parameters' => [
  163. 'name' => [
  164. 'location' => 'path',
  165. 'type' => 'string',
  166. 'required' => true,
  167. ],
  168. 'pageSize' => [
  169. 'location' => 'query',
  170. 'type' => 'integer',
  171. ],
  172. 'pageToken' => [
  173. 'location' => 'query',
  174. 'type' => 'string',
  175. ],
  176. ],
  177. ],
  178. ]
  179. ]
  180. );
  181. $this->projects = new Cloudbilling\Resource\Projects(
  182. $this,
  183. $this->serviceName,
  184. 'projects',
  185. [
  186. 'methods' => [
  187. 'getBillingInfo' => [
  188. 'path' => 'v1/{+name}/billingInfo',
  189. 'httpMethod' => 'GET',
  190. 'parameters' => [
  191. 'name' => [
  192. 'location' => 'path',
  193. 'type' => 'string',
  194. 'required' => true,
  195. ],
  196. ],
  197. ],'updateBillingInfo' => [
  198. 'path' => 'v1/{+name}/billingInfo',
  199. 'httpMethod' => 'PUT',
  200. 'parameters' => [
  201. 'name' => [
  202. 'location' => 'path',
  203. 'type' => 'string',
  204. 'required' => true,
  205. ],
  206. ],
  207. ],
  208. ]
  209. ]
  210. );
  211. $this->services = new Cloudbilling\Resource\Services(
  212. $this,
  213. $this->serviceName,
  214. 'services',
  215. [
  216. 'methods' => [
  217. 'list' => [
  218. 'path' => 'v1/services',
  219. 'httpMethod' => 'GET',
  220. 'parameters' => [
  221. 'pageSize' => [
  222. 'location' => 'query',
  223. 'type' => 'integer',
  224. ],
  225. 'pageToken' => [
  226. 'location' => 'query',
  227. 'type' => 'string',
  228. ],
  229. ],
  230. ],
  231. ]
  232. ]
  233. );
  234. $this->services_skus = new Cloudbilling\Resource\ServicesSkus(
  235. $this,
  236. $this->serviceName,
  237. 'skus',
  238. [
  239. 'methods' => [
  240. 'list' => [
  241. 'path' => 'v1/{+parent}/skus',
  242. 'httpMethod' => 'GET',
  243. 'parameters' => [
  244. 'parent' => [
  245. 'location' => 'path',
  246. 'type' => 'string',
  247. 'required' => true,
  248. ],
  249. 'currencyCode' => [
  250. 'location' => 'query',
  251. 'type' => 'string',
  252. ],
  253. 'endTime' => [
  254. 'location' => 'query',
  255. 'type' => 'string',
  256. ],
  257. 'pageSize' => [
  258. 'location' => 'query',
  259. 'type' => 'integer',
  260. ],
  261. 'pageToken' => [
  262. 'location' => 'query',
  263. 'type' => 'string',
  264. ],
  265. 'startTime' => [
  266. 'location' => 'query',
  267. 'type' => 'string',
  268. ],
  269. ],
  270. ],
  271. ]
  272. ]
  273. );
  274. }
  275. }
  276. // Adding a class alias for backwards compatibility with the previous class name.
  277. class_alias(Cloudbilling::class, 'Google_Service_Cloudbilling');