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\Backupdr\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Backupdr\ListManagementServersResponse;
|
---|
21 | use Google\Service\Backupdr\ManagementServer;
|
---|
22 | use Google\Service\Backupdr\Operation;
|
---|
23 | use Google\Service\Backupdr\Policy;
|
---|
24 | use Google\Service\Backupdr\SetIamPolicyRequest;
|
---|
25 | use Google\Service\Backupdr\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\Backupdr\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "managementServers" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $backupdrService = new Google\Service\Backupdr(...);
|
---|
33 | * $managementServers = $backupdrService->projects_locations_managementServers;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsManagementServers extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a new ManagementServer in a given project and location.
|
---|
40 | * (managementServers.create)
|
---|
41 | *
|
---|
42 | * @param string $parent Required. The management server project and location in
|
---|
43 | * the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and
|
---|
44 | * DR locations map to Google Cloud regions, for example **us-central1**.
|
---|
45 | * @param ManagementServer $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | *
|
---|
48 | * @opt_param string managementServerId Required. The name of the management
|
---|
49 | * server to create. The name must be unique for the specified project and
|
---|
50 | * location.
|
---|
51 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
52 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
53 | * the server will know to ignore the request if it has already been completed.
|
---|
54 | * The server will guarantee that for at least 60 minutes since the first
|
---|
55 | * request. For example, consider a situation where you make an initial request
|
---|
56 | * and the request times out. If you make the request again with the same
|
---|
57 | * request ID, the server can check if original operation with the same request
|
---|
58 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
59 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
60 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
61 | * (00000000-0000-0000-0000-000000000000).
|
---|
62 | * @return Operation
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function create($parent, ManagementServer $postBody, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('create', [$params], Operation::class);
|
---|
70 | }
|
---|
71 | /**
|
---|
72 | * Deletes a single ManagementServer. (managementServers.delete)
|
---|
73 | *
|
---|
74 | * @param string $name Required. Name of the resource
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | *
|
---|
77 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
78 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
79 | * the server will know to ignore the request if it has already been completed.
|
---|
80 | * The server will guarantee that for at least 60 minutes after the first
|
---|
81 | * request. For example, consider a situation where you make an initial request
|
---|
82 | * and the request times out. If you make the request again with the same
|
---|
83 | * request ID, the server can check if original operation with the same request
|
---|
84 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
85 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
86 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
87 | * (00000000-0000-0000-0000-000000000000).
|
---|
88 | * @return Operation
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function delete($name, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['name' => $name];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('delete', [$params], Operation::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Gets details of a single ManagementServer. (managementServers.get)
|
---|
99 | *
|
---|
100 | * @param string $name Required. Name of the management server resource name, in
|
---|
101 | * the format 'projects/{project_id}/locations/{location}/managementServers/{res
|
---|
102 | * ource_name}'
|
---|
103 | * @param array $optParams Optional parameters.
|
---|
104 | * @return ManagementServer
|
---|
105 | * @throws \Google\Service\Exception
|
---|
106 | */
|
---|
107 | public function get($name, $optParams = [])
|
---|
108 | {
|
---|
109 | $params = ['name' => $name];
|
---|
110 | $params = array_merge($params, $optParams);
|
---|
111 | return $this->call('get', [$params], ManagementServer::class);
|
---|
112 | }
|
---|
113 | /**
|
---|
114 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
115 | * resource exists and does not have a policy set.
|
---|
116 | * (managementServers.getIamPolicy)
|
---|
117 | *
|
---|
118 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
119 | * requested. See [Resource
|
---|
120 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
121 | * appropriate value for this field.
|
---|
122 | * @param array $optParams Optional parameters.
|
---|
123 | *
|
---|
124 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
125 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
126 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
127 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
128 | * conditional role bindings may specify any valid value or leave the field
|
---|
129 | * unset. The policy in the response might use the policy version that you
|
---|
130 | * specified, or it might use a lower policy version. For example, if you
|
---|
131 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
132 | * response uses version 1. To learn which resources support conditions in their
|
---|
133 | * IAM policies, see the [IAM
|
---|
134 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
135 | * policies).
|
---|
136 | * @return Policy
|
---|
137 | * @throws \Google\Service\Exception
|
---|
138 | */
|
---|
139 | public function getIamPolicy($resource, $optParams = [])
|
---|
140 | {
|
---|
141 | $params = ['resource' => $resource];
|
---|
142 | $params = array_merge($params, $optParams);
|
---|
143 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
144 | }
|
---|
145 | /**
|
---|
146 | * Lists ManagementServers in a given project and location.
|
---|
147 | * (managementServers.listProjectsLocationsManagementServers)
|
---|
148 | *
|
---|
149 | * @param string $parent Required. The project and location for which to
|
---|
150 | * retrieve management servers information, in the format
|
---|
151 | * 'projects/{project_id}/locations/{location}'. In Cloud BackupDR, locations
|
---|
152 | * map to Google Cloud regions, for example **us-central1**. To retrieve
|
---|
153 | * management servers for all locations, use "-" for the '{location}' value.
|
---|
154 | * @param array $optParams Optional parameters.
|
---|
155 | *
|
---|
156 | * @opt_param string filter Optional. Filtering results.
|
---|
157 | * @opt_param string orderBy Optional. Hint for how to order the results.
|
---|
158 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
159 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
160 | * default.
|
---|
161 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
162 | * the server should return.
|
---|
163 | * @return ListManagementServersResponse
|
---|
164 | * @throws \Google\Service\Exception
|
---|
165 | */
|
---|
166 | public function listProjectsLocationsManagementServers($parent, $optParams = [])
|
---|
167 | {
|
---|
168 | $params = ['parent' => $parent];
|
---|
169 | $params = array_merge($params, $optParams);
|
---|
170 | return $this->call('list', [$params], ListManagementServersResponse::class);
|
---|
171 | }
|
---|
172 | /**
|
---|
173 | * Sets the access control policy on the specified resource. Replaces any
|
---|
174 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
175 | * `PERMISSION_DENIED` errors. (managementServers.setIamPolicy)
|
---|
176 | *
|
---|
177 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
178 | * specified. See [Resource
|
---|
179 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
180 | * appropriate value for this field.
|
---|
181 | * @param SetIamPolicyRequest $postBody
|
---|
182 | * @param array $optParams Optional parameters.
|
---|
183 | * @return Policy
|
---|
184 | * @throws \Google\Service\Exception
|
---|
185 | */
|
---|
186 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
187 | {
|
---|
188 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
189 | $params = array_merge($params, $optParams);
|
---|
190 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
191 | }
|
---|
192 | /**
|
---|
193 | * Returns permissions that a caller has on the specified resource. If the
|
---|
194 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
195 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
196 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
197 | * This operation may "fail open" without warning.
|
---|
198 | * (managementServers.testIamPermissions)
|
---|
199 | *
|
---|
200 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
201 | * being requested. See [Resource
|
---|
202 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
203 | * appropriate value for this field.
|
---|
204 | * @param TestIamPermissionsRequest $postBody
|
---|
205 | * @param array $optParams Optional parameters.
|
---|
206 | * @return TestIamPermissionsResponse
|
---|
207 | * @throws \Google\Service\Exception
|
---|
208 | */
|
---|
209 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
210 | {
|
---|
211 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
212 | $params = array_merge($params, $optParams);
|
---|
213 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
214 | }
|
---|
215 | }
|
---|
216 |
|
---|
217 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
218 | class_alias(ProjectsLocationsManagementServers::class, 'Google_Service_Backupdr_Resource_ProjectsLocationsManagementServers');
|
---|