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 |
|
---|
18 | namespace Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\ListPeeringsResponse;
|
---|
21 | use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Operation;
|
---|
22 | use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Peering;
|
---|
23 | use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Policy;
|
---|
24 | use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\SetIamPolicyRequest;
|
---|
25 | use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "peerings" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $managedidentitiesService = new Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI(...);
|
---|
33 | * $peerings = $managedidentitiesService->projects_locations_global_peerings;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsManagedidentitiesGlobalPeerings extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a Peering for Managed AD instance. (peerings.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. Resource project name and location using the
|
---|
42 | * form: `projects/{project_id}/locations/global`
|
---|
43 | * @param Peering $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | *
|
---|
46 | * @opt_param string peeringId Required. Peering Id, unique name to identify
|
---|
47 | * peering. It should follow the regex format
|
---|
48 | * "^(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)$"
|
---|
49 | * @return Operation
|
---|
50 | * @throws \Google\Service\Exception
|
---|
51 | */
|
---|
52 | public function create($parent, Peering $postBody, $optParams = [])
|
---|
53 | {
|
---|
54 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
55 | $params = array_merge($params, $optParams);
|
---|
56 | return $this->call('create', [$params], Operation::class);
|
---|
57 | }
|
---|
58 | /**
|
---|
59 | * Deletes identified Peering. (peerings.delete)
|
---|
60 | *
|
---|
61 | * @param string $name Required. Peering resource name using the form:
|
---|
62 | * `projects/{project_id}/locations/global/peerings/{peering_id}`
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return Operation
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function delete($name, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['name' => $name];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('delete', [$params], Operation::class);
|
---|
72 | }
|
---|
73 | /**
|
---|
74 | * Gets details of a single Peering. (peerings.get)
|
---|
75 | *
|
---|
76 | * @param string $name Required. Peering resource name using the form:
|
---|
77 | * `projects/{project_id}/locations/global/peerings/{peering_id}`
|
---|
78 | * @param array $optParams Optional parameters.
|
---|
79 | * @return Peering
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function get($name, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['name' => $name];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('get', [$params], Peering::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
90 | * resource exists and does not have a policy set. (peerings.getIamPolicy)
|
---|
91 | *
|
---|
92 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
93 | * requested. See [Resource
|
---|
94 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
95 | * appropriate value for this field.
|
---|
96 | * @param array $optParams Optional parameters.
|
---|
97 | *
|
---|
98 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
99 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
100 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
101 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
102 | * conditional role bindings may specify any valid value or leave the field
|
---|
103 | * unset. The policy in the response might use the policy version that you
|
---|
104 | * specified, or it might use a lower policy version. For example, if you
|
---|
105 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
106 | * response uses version 1. To learn which resources support conditions in their
|
---|
107 | * IAM policies, see the [IAM
|
---|
108 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
109 | * policies).
|
---|
110 | * @return Policy
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function getIamPolicy($resource, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['resource' => $resource];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
118 | }
|
---|
119 | /**
|
---|
120 | * Lists Peerings in a given project.
|
---|
121 | * (peerings.listProjectsLocationsManagedidentitiesGlobalPeerings)
|
---|
122 | *
|
---|
123 | * @param string $parent Required. The resource name of the peering location
|
---|
124 | * using the form: `projects/{project_id}/locations/global`
|
---|
125 | * @param array $optParams Optional parameters.
|
---|
126 | *
|
---|
127 | * @opt_param string filter Optional. Filter specifying constraints of a list
|
---|
128 | * operation. For example, `peering.authorized_network="projects/myprojectid/glo
|
---|
129 | * bal/networks/mynetwork"`.
|
---|
130 | * @opt_param string orderBy Optional. Specifies the ordering of results
|
---|
131 | * following syntax at
|
---|
132 | * https://cloud.google.com/apis/design/design_patterns#sorting_order.
|
---|
133 | * @opt_param int pageSize Optional. The maximum number of items to return. If
|
---|
134 | * not specified, a default value of 1000 will be used by the service.
|
---|
135 | * Regardless of the page_size value, the response may include a partial list
|
---|
136 | * and a caller should only rely on response's next_page_token to determine if
|
---|
137 | * there are more instances left to be queried.
|
---|
138 | * @opt_param string pageToken Optional. The next_page_token value returned from
|
---|
139 | * a previous List request, if any.
|
---|
140 | * @return ListPeeringsResponse
|
---|
141 | * @throws \Google\Service\Exception
|
---|
142 | */
|
---|
143 | public function listProjectsLocationsManagedidentitiesGlobalPeerings($parent, $optParams = [])
|
---|
144 | {
|
---|
145 | $params = ['parent' => $parent];
|
---|
146 | $params = array_merge($params, $optParams);
|
---|
147 | return $this->call('list', [$params], ListPeeringsResponse::class);
|
---|
148 | }
|
---|
149 | /**
|
---|
150 | * Updates the labels for specified Peering. (peerings.patch)
|
---|
151 | *
|
---|
152 | * @param string $name Output only. Unique name of the peering in this scope
|
---|
153 | * including projects and location using the form:
|
---|
154 | * `projects/{project_id}/locations/global/peerings/{peering_id}`.
|
---|
155 | * @param Peering $postBody
|
---|
156 | * @param array $optParams Optional parameters.
|
---|
157 | *
|
---|
158 | * @opt_param string updateMask Required. Mask of fields to update. At least one
|
---|
159 | * path must be supplied in this field. The elements of the repeated paths field
|
---|
160 | * may only include these fields from Peering: * `labels`
|
---|
161 | * @return Operation
|
---|
162 | * @throws \Google\Service\Exception
|
---|
163 | */
|
---|
164 | public function patch($name, Peering $postBody, $optParams = [])
|
---|
165 | {
|
---|
166 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
167 | $params = array_merge($params, $optParams);
|
---|
168 | return $this->call('patch', [$params], Operation::class);
|
---|
169 | }
|
---|
170 | /**
|
---|
171 | * Sets the access control policy on the specified resource. Replaces any
|
---|
172 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
173 | * `PERMISSION_DENIED` errors. (peerings.setIamPolicy)
|
---|
174 | *
|
---|
175 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
176 | * specified. See [Resource
|
---|
177 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
178 | * appropriate value for this field.
|
---|
179 | * @param SetIamPolicyRequest $postBody
|
---|
180 | * @param array $optParams Optional parameters.
|
---|
181 | * @return Policy
|
---|
182 | * @throws \Google\Service\Exception
|
---|
183 | */
|
---|
184 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
185 | {
|
---|
186 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
187 | $params = array_merge($params, $optParams);
|
---|
188 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
189 | }
|
---|
190 | /**
|
---|
191 | * Returns permissions that a caller has on the specified resource. If the
|
---|
192 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
193 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
194 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
195 | * This operation may "fail open" without warning. (peerings.testIamPermissions)
|
---|
196 | *
|
---|
197 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
198 | * being requested. See [Resource
|
---|
199 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
200 | * appropriate value for this field.
|
---|
201 | * @param TestIamPermissionsRequest $postBody
|
---|
202 | * @param array $optParams Optional parameters.
|
---|
203 | * @return TestIamPermissionsResponse
|
---|
204 | * @throws \Google\Service\Exception
|
---|
205 | */
|
---|
206 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
207 | {
|
---|
208 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
209 | $params = array_merge($params, $optParams);
|
---|
210 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
211 | }
|
---|
212 | }
|
---|
213 |
|
---|
214 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
215 | class_alias(ProjectsLocationsManagedidentitiesGlobalPeerings::class, 'Google_Service_ManagedServiceforMicrosoftActiveDirectoryConsumerAPI_Resource_ProjectsLocationsManagedidentitiesGlobalPeerings');
|
---|