source: vendor/google/apiclient-services/src/NetworkSecurity/Resource/ProjectsLocationsAuthorizationPolicies.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload project files

  • Property mode set to 100644
File size: 9.6 KB
Line 
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\NetworkSecurity\Resource;
19
20use Google\Service\NetworkSecurity\AuthorizationPolicy;
21use Google\Service\NetworkSecurity\GoogleIamV1Policy;
22use Google\Service\NetworkSecurity\GoogleIamV1SetIamPolicyRequest;
23use Google\Service\NetworkSecurity\GoogleIamV1TestIamPermissionsRequest;
24use Google\Service\NetworkSecurity\GoogleIamV1TestIamPermissionsResponse;
25use Google\Service\NetworkSecurity\ListAuthorizationPoliciesResponse;
26use Google\Service\NetworkSecurity\Operation;
27
28/**
29 * The "authorizationPolicies" collection of methods.
30 * Typical usage is:
31 * <code>
32 * $networksecurityService = new Google\Service\NetworkSecurity(...);
33 * $authorizationPolicies = $networksecurityService->projects_locations_authorizationPolicies;
34 * </code>
35 */
36class ProjectsLocationsAuthorizationPolicies extends \Google\Service\Resource
37{
38 /**
39 * Creates a new AuthorizationPolicy in a given project and location.
40 * (authorizationPolicies.create)
41 *
42 * @param string $parent Required. The parent resource of the
43 * AuthorizationPolicy. Must be in the format
44 * `projects/{project}/locations/{location}`.
45 * @param AuthorizationPolicy $postBody
46 * @param array $optParams Optional parameters.
47 *
48 * @opt_param string authorizationPolicyId Required. Short name of the
49 * AuthorizationPolicy resource to be created. This value should be 1-63
50 * characters long, containing only letters, numbers, hyphens, and underscores,
51 * and should not start with a number. E.g. "authz_policy".
52 * @return Operation
53 * @throws \Google\Service\Exception
54 */
55 public function create($parent, AuthorizationPolicy $postBody, $optParams = [])
56 {
57 $params = ['parent' => $parent, 'postBody' => $postBody];
58 $params = array_merge($params, $optParams);
59 return $this->call('create', [$params], Operation::class);
60 }
61 /**
62 * Deletes a single AuthorizationPolicy. (authorizationPolicies.delete)
63 *
64 * @param string $name Required. A name of the AuthorizationPolicy to delete.
65 * Must be in the format
66 * `projects/{project}/locations/{location}/authorizationPolicies`.
67 * @param array $optParams Optional parameters.
68 * @return Operation
69 * @throws \Google\Service\Exception
70 */
71 public function delete($name, $optParams = [])
72 {
73 $params = ['name' => $name];
74 $params = array_merge($params, $optParams);
75 return $this->call('delete', [$params], Operation::class);
76 }
77 /**
78 * Gets details of a single AuthorizationPolicy. (authorizationPolicies.get)
79 *
80 * @param string $name Required. A name of the AuthorizationPolicy to get. Must
81 * be in the format
82 * `projects/{project}/locations/{location}/authorizationPolicies`.
83 * @param array $optParams Optional parameters.
84 * @return AuthorizationPolicy
85 * @throws \Google\Service\Exception
86 */
87 public function get($name, $optParams = [])
88 {
89 $params = ['name' => $name];
90 $params = array_merge($params, $optParams);
91 return $this->call('get', [$params], AuthorizationPolicy::class);
92 }
93 /**
94 * Gets the access control policy for a resource. Returns an empty policy if the
95 * resource exists and does not have a policy set.
96 * (authorizationPolicies.getIamPolicy)
97 *
98 * @param string $resource REQUIRED: The resource for which the policy is being
99 * requested. See [Resource
100 * names](https://cloud.google.com/apis/design/resource_names) for the
101 * appropriate value for this field.
102 * @param array $optParams Optional parameters.
103 *
104 * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
105 * version that will be used to format the policy. Valid values are 0, 1, and 3.
106 * Requests specifying an invalid value will be rejected. Requests for policies
107 * with any conditional role bindings must specify version 3. Policies with no
108 * conditional role bindings may specify any valid value or leave the field
109 * unset. The policy in the response might use the policy version that you
110 * specified, or it might use a lower policy version. For example, if you
111 * specify version 3, but the policy has no conditional role bindings, the
112 * response uses version 1. To learn which resources support conditions in their
113 * IAM policies, see the [IAM
114 * documentation](https://cloud.google.com/iam/help/conditions/resource-
115 * policies).
116 * @return GoogleIamV1Policy
117 * @throws \Google\Service\Exception
118 */
119 public function getIamPolicy($resource, $optParams = [])
120 {
121 $params = ['resource' => $resource];
122 $params = array_merge($params, $optParams);
123 return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
124 }
125 /**
126 * Lists AuthorizationPolicies in a given project and location.
127 * (authorizationPolicies.listProjectsLocationsAuthorizationPolicies)
128 *
129 * @param string $parent Required. The project and location from which the
130 * AuthorizationPolicies should be listed, specified in the format
131 * `projects/{project}/locations/{location}`.
132 * @param array $optParams Optional parameters.
133 *
134 * @opt_param int pageSize Maximum number of AuthorizationPolicies to return per
135 * call.
136 * @opt_param string pageToken The value returned by the last
137 * `ListAuthorizationPoliciesResponse` Indicates that this is a continuation of
138 * a prior `ListAuthorizationPolicies` call, and that the system should return
139 * the next page of data.
140 * @return ListAuthorizationPoliciesResponse
141 * @throws \Google\Service\Exception
142 */
143 public function listProjectsLocationsAuthorizationPolicies($parent, $optParams = [])
144 {
145 $params = ['parent' => $parent];
146 $params = array_merge($params, $optParams);
147 return $this->call('list', [$params], ListAuthorizationPoliciesResponse::class);
148 }
149 /**
150 * Updates the parameters of a single AuthorizationPolicy.
151 * (authorizationPolicies.patch)
152 *
153 * @param string $name Required. Name of the AuthorizationPolicy resource. It
154 * matches pattern
155 * `projects/{project}/locations/{location}/authorizationPolicies/`.
156 * @param AuthorizationPolicy $postBody
157 * @param array $optParams Optional parameters.
158 *
159 * @opt_param string updateMask Optional. Field mask is used to specify the
160 * fields to be overwritten in the AuthorizationPolicy resource by the update.
161 * The fields specified in the update_mask are relative to the resource, not the
162 * full request. A field will be overwritten if it is in the mask. If the user
163 * does not provide a mask then all fields will be overwritten.
164 * @return Operation
165 * @throws \Google\Service\Exception
166 */
167 public function patch($name, AuthorizationPolicy $postBody, $optParams = [])
168 {
169 $params = ['name' => $name, 'postBody' => $postBody];
170 $params = array_merge($params, $optParams);
171 return $this->call('patch', [$params], Operation::class);
172 }
173 /**
174 * Sets the access control policy on the specified resource. Replaces any
175 * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
176 * `PERMISSION_DENIED` errors. (authorizationPolicies.setIamPolicy)
177 *
178 * @param string $resource REQUIRED: The resource for which the policy is being
179 * specified. See [Resource
180 * names](https://cloud.google.com/apis/design/resource_names) for the
181 * appropriate value for this field.
182 * @param GoogleIamV1SetIamPolicyRequest $postBody
183 * @param array $optParams Optional parameters.
184 * @return GoogleIamV1Policy
185 * @throws \Google\Service\Exception
186 */
187 public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
188 {
189 $params = ['resource' => $resource, 'postBody' => $postBody];
190 $params = array_merge($params, $optParams);
191 return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
192 }
193 /**
194 * Returns permissions that a caller has on the specified resource. If the
195 * resource does not exist, this will return an empty set of permissions, not a
196 * `NOT_FOUND` error. Note: This operation is designed to be used for building
197 * permission-aware UIs and command-line tools, not for authorization checking.
198 * This operation may "fail open" without warning.
199 * (authorizationPolicies.testIamPermissions)
200 *
201 * @param string $resource REQUIRED: The resource for which the policy detail is
202 * being requested. See [Resource
203 * names](https://cloud.google.com/apis/design/resource_names) for the
204 * appropriate value for this field.
205 * @param GoogleIamV1TestIamPermissionsRequest $postBody
206 * @param array $optParams Optional parameters.
207 * @return GoogleIamV1TestIamPermissionsResponse
208 * @throws \Google\Service\Exception
209 */
210 public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
211 {
212 $params = ['resource' => $resource, 'postBody' => $postBody];
213 $params = array_merge($params, $optParams);
214 return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
215 }
216}
217
218// Adding a class alias for backwards compatibility with the previous class name.
219class_alias(ProjectsLocationsAuthorizationPolicies::class, 'Google_Service_NetworkSecurity_Resource_ProjectsLocationsAuthorizationPolicies');
Note: See TracBrowser for help on using the repository browser.