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\Clouderrorreporting\Resource;
19
20use Google\Service\Clouderrorreporting\ErrorGroup;
21
22/**
23 * The "groups" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $clouderrorreportingService = new Google\Service\Clouderrorreporting(...);
27 *   $groups = $clouderrorreportingService->groups;
28 *  </code>
29 */
30class ProjectsGroups extends \Google\Service\Resource
31{
32  /**
33   * Get the specified group. (groups.get)
34   *
35   * @param string $groupName Required. The group resource name. Written as
36   * `projects/{projectID}/groups/{group_name}`. Call
37   * [`groupStats.list`](https://cloud.google.com/error-
38   * reporting/reference/rest/v1beta1/projects.groupStats/list) to return a list
39   * of groups belonging to this project. Example: `projects/my-project-123/groups
40   * /my-group`
41   * @param array $optParams Optional parameters.
42   * @return ErrorGroup
43   */
44  public function get($groupName, $optParams = [])
45  {
46    $params = ['groupName' => $groupName];
47    $params = array_merge($params, $optParams);
48    return $this->call('get', [$params], ErrorGroup::class);
49  }
50  /**
51   * Replace the data for the specified group. Fails if the group does not exist.
52   * (groups.update)
53   *
54   * @param string $name The group resource name. Example: projects/my-
55   * project-123/groups/CNSgkpnppqKCUw
56   * @param ErrorGroup $postBody
57   * @param array $optParams Optional parameters.
58   * @return ErrorGroup
59   */
60  public function update($name, ErrorGroup $postBody, $optParams = [])
61  {
62    $params = ['name' => $name, 'postBody' => $postBody];
63    $params = array_merge($params, $optParams);
64    return $this->call('update', [$params], ErrorGroup::class);
65  }
66}
67
68// Adding a class alias for backwards compatibility with the previous class name.
69class_alias(ProjectsGroups::class, 'Google_Service_Clouderrorreporting_Resource_ProjectsGroups');
70