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