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\Networkconnectivity\Resource;
19
20use Google\Service\Networkconnectivity\Policy;
21use Google\Service\Networkconnectivity\SetIamPolicyRequest;
22use Google\Service\Networkconnectivity\TestIamPermissionsRequest;
23use Google\Service\Networkconnectivity\TestIamPermissionsResponse;
24
25/**
26 * The "internalRanges" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $networkconnectivityService = new Google\Service\Networkconnectivity(...);
30 *   $internalRanges = $networkconnectivityService->internalRanges;
31 *  </code>
32 */
33class ProjectsLocationsInternalRanges extends \Google\Service\Resource
34{
35  /**
36   * Gets the access control policy for a resource. Returns an empty policy if the
37   * resource exists and does not have a policy set. (internalRanges.getIamPolicy)
38   *
39   * @param string $resource REQUIRED: The resource for which the policy is being
40   * requested. See the operation documentation for the appropriate value for this
41   * field.
42   * @param array $optParams Optional parameters.
43   *
44   * @opt_param int options.requestedPolicyVersion Optional. The policy format
45   * version to be returned. Valid values are 0, 1, and 3. Requests specifying an
46   * invalid value will be rejected. Requests for policies with any conditional
47   * bindings must specify version 3. Policies without any conditional bindings
48   * may specify any valid value or leave the field unset. To learn which
49   * resources support conditions in their IAM policies, see the [IAM
50   * documentation](https://cloud.google.com/iam/help/conditions/resource-
51   * policies).
52   * @return Policy
53   */
54  public function getIamPolicy($resource, $optParams = [])
55  {
56    $params = ['resource' => $resource];
57    $params = array_merge($params, $optParams);
58    return $this->call('getIamPolicy', [$params], Policy::class);
59  }
60  /**
61   * Sets the access control policy on the specified resource. Replaces any
62   * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
63   * `PERMISSION_DENIED` errors. (internalRanges.setIamPolicy)
64   *
65   * @param string $resource REQUIRED: The resource for which the policy is being
66   * specified. See the operation documentation for the appropriate value for this
67   * field.
68   * @param SetIamPolicyRequest $postBody
69   * @param array $optParams Optional parameters.
70   * @return Policy
71   */
72  public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
73  {
74    $params = ['resource' => $resource, 'postBody' => $postBody];
75    $params = array_merge($params, $optParams);
76    return $this->call('setIamPolicy', [$params], Policy::class);
77  }
78  /**
79   * Returns permissions that a caller has on the specified resource. If the
80   * resource does not exist, this will return an empty set of permissions, not a
81   * `NOT_FOUND` error. Note: This operation is designed to be used for building
82   * permission-aware UIs and command-line tools, not for authorization checking.
83   * This operation may "fail open" without warning.
84   * (internalRanges.testIamPermissions)
85   *
86   * @param string $resource REQUIRED: The resource for which the policy detail is
87   * being requested. See the operation documentation for the appropriate value
88   * for this field.
89   * @param TestIamPermissionsRequest $postBody
90   * @param array $optParams Optional parameters.
91   * @return TestIamPermissionsResponse
92   */
93  public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
94  {
95    $params = ['resource' => $resource, 'postBody' => $postBody];
96    $params = array_merge($params, $optParams);
97    return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
98  }
99}
100
101// Adding a class alias for backwards compatibility with the previous class name.
102class_alias(ProjectsLocationsInternalRanges::class, 'Google_Service_Networkconnectivity_Resource_ProjectsLocationsInternalRanges');
103