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\Cloudbilling\Resource;
19
20use Google\Service\Cloudbilling\ListProjectBillingInfoResponse;
21
22/**
23 * The "projects" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $cloudbillingService = new Google\Service\Cloudbilling(...);
27 *   $projects = $cloudbillingService->projects;
28 *  </code>
29 */
30class BillingAccountsProjects extends \Google\Service\Resource
31{
32  /**
33   * Lists the projects associated with a billing account. The current
34   * authenticated user must have the `billing.resourceAssociations.list` IAM
35   * permission, which is often given to billing account
36   * [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).
37   * (projects.listBillingAccountsProjects)
38   *
39   * @param string $name Required. The resource name of the billing account
40   * associated with the projects that you want to list. For example,
41   * `billingAccounts/012345-567890-ABCDEF`.
42   * @param array $optParams Optional parameters.
43   *
44   * @opt_param int pageSize Requested page size. The maximum page size is 100;
45   * this is also the default.
46   * @opt_param string pageToken A token identifying a page of results to be
47   * returned. This should be a `next_page_token` value returned from a previous
48   * `ListProjectBillingInfo` call. If unspecified, the first page of results is
49   * returned.
50   * @return ListProjectBillingInfoResponse
51   */
52  public function listBillingAccountsProjects($name, $optParams = [])
53  {
54    $params = ['name' => $name];
55    $params = array_merge($params, $optParams);
56    return $this->call('list', [$params], ListProjectBillingInfoResponse::class);
57  }
58}
59
60// Adding a class alias for backwards compatibility with the previous class name.
61class_alias(BillingAccountsProjects::class, 'Google_Service_Cloudbilling_Resource_BillingAccountsProjects');
62