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