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\CloudIot\Resource;
19
20use Google\Service\CloudIot\GetIamPolicyRequest;
21use Google\Service\CloudIot\Policy;
22use Google\Service\CloudIot\SetIamPolicyRequest;
23use Google\Service\CloudIot\TestIamPermissionsRequest;
24use Google\Service\CloudIot\TestIamPermissionsResponse;
25
26/**
27 * The "groups" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $cloudiotService = new Google\Service\CloudIot(...);
31 *   $groups = $cloudiotService->groups;
32 *  </code>
33 */
34class ProjectsLocationsRegistriesGroups extends \Google\Service\Resource
35{
36  /**
37   * Gets the access control policy for a resource. Returns an empty policy if the
38   * resource exists and does not have a policy set. (groups.getIamPolicy)
39   *
40   * @param string $resource REQUIRED: The resource for which the policy is being
41   * requested. See the operation documentation for the appropriate value for this
42   * field.
43   * @param GetIamPolicyRequest $postBody
44   * @param array $optParams Optional parameters.
45   * @return Policy
46   */
47  public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
48  {
49    $params = ['resource' => $resource, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('getIamPolicy', [$params], Policy::class);
52  }
53  /**
54   * Sets the access control policy on the specified resource. Replaces any
55   * existing policy. (groups.setIamPolicy)
56   *
57   * @param string $resource REQUIRED: The resource for which the policy is being
58   * specified. See the operation documentation for the appropriate value for this
59   * field.
60   * @param SetIamPolicyRequest $postBody
61   * @param array $optParams Optional parameters.
62   * @return Policy
63   */
64  public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
65  {
66    $params = ['resource' => $resource, 'postBody' => $postBody];
67    $params = array_merge($params, $optParams);
68    return $this->call('setIamPolicy', [$params], Policy::class);
69  }
70  /**
71   * Returns permissions that a caller has on the specified resource. If the
72   * resource does not exist, this will return an empty set of permissions, not a
73   * NOT_FOUND error. (groups.testIamPermissions)
74   *
75   * @param string $resource REQUIRED: The resource for which the policy detail is
76   * being requested. See the operation documentation for the appropriate value
77   * for this field.
78   * @param TestIamPermissionsRequest $postBody
79   * @param array $optParams Optional parameters.
80   * @return TestIamPermissionsResponse
81   */
82  public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
83  {
84    $params = ['resource' => $resource, 'postBody' => $postBody];
85    $params = array_merge($params, $optParams);
86    return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
87  }
88}
89
90// Adding a class alias for backwards compatibility with the previous class name.
91class_alias(ProjectsLocationsRegistriesGroups::class, 'Google_Service_CloudIot_Resource_ProjectsLocationsRegistriesGroups');
92