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\DatabaseMigrationService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DatabaseMigrationService\ListPrivateConnectionsResponse;
|
---|
21 | use Google\Service\DatabaseMigrationService\Operation;
|
---|
22 | use Google\Service\DatabaseMigrationService\Policy;
|
---|
23 | use Google\Service\DatabaseMigrationService\PrivateConnection;
|
---|
24 | use Google\Service\DatabaseMigrationService\SetIamPolicyRequest;
|
---|
25 | use Google\Service\DatabaseMigrationService\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\DatabaseMigrationService\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "privateConnections" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $datamigrationService = new Google\Service\DatabaseMigrationService(...);
|
---|
33 | * $privateConnections = $datamigrationService->projects_locations_privateConnections;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsPrivateConnections extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a new private connection in a given project and location.
|
---|
40 | * (privateConnections.create)
|
---|
41 | *
|
---|
42 | * @param string $parent Required. The parent that owns the collection of
|
---|
43 | * PrivateConnections.
|
---|
44 | * @param PrivateConnection $postBody
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | *
|
---|
47 | * @opt_param string privateConnectionId Required. The private connection
|
---|
48 | * identifier.
|
---|
49 | * @opt_param string requestId Optional. A unique ID used to identify the
|
---|
50 | * request. If the server receives two requests with the same ID, then the
|
---|
51 | * second request is ignored. It is recommended to always set this value to a
|
---|
52 | * UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
|
---|
53 | * (_), and hyphens (-). The maximum length is 40 characters.
|
---|
54 | * @opt_param bool skipValidation Optional. If set to true, will skip
|
---|
55 | * validations.
|
---|
56 | * @return Operation
|
---|
57 | * @throws \Google\Service\Exception
|
---|
58 | */
|
---|
59 | public function create($parent, PrivateConnection $postBody, $optParams = [])
|
---|
60 | {
|
---|
61 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
62 | $params = array_merge($params, $optParams);
|
---|
63 | return $this->call('create', [$params], Operation::class);
|
---|
64 | }
|
---|
65 | /**
|
---|
66 | * Deletes a single Database Migration Service private connection.
|
---|
67 | * (privateConnections.delete)
|
---|
68 | *
|
---|
69 | * @param string $name Required. The name of the private connection to delete.
|
---|
70 | * @param array $optParams Optional parameters.
|
---|
71 | *
|
---|
72 | * @opt_param string requestId Optional. A unique ID used to identify the
|
---|
73 | * request. If the server receives two requests with the same ID, then the
|
---|
74 | * second request is ignored. It is recommended to always set this value to a
|
---|
75 | * UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
|
---|
76 | * (_), and hyphens (-). The maximum length is 40 characters.
|
---|
77 | * @return Operation
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function delete($name, $optParams = [])
|
---|
81 | {
|
---|
82 | $params = ['name' => $name];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('delete', [$params], Operation::class);
|
---|
85 | }
|
---|
86 | /**
|
---|
87 | * Gets details of a single private connection. (privateConnections.get)
|
---|
88 | *
|
---|
89 | * @param string $name Required. The name of the private connection to get.
|
---|
90 | * @param array $optParams Optional parameters.
|
---|
91 | * @return PrivateConnection
|
---|
92 | * @throws \Google\Service\Exception
|
---|
93 | */
|
---|
94 | public function get($name, $optParams = [])
|
---|
95 | {
|
---|
96 | $params = ['name' => $name];
|
---|
97 | $params = array_merge($params, $optParams);
|
---|
98 | return $this->call('get', [$params], PrivateConnection::class);
|
---|
99 | }
|
---|
100 | /**
|
---|
101 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
102 | * resource exists and does not have a policy set.
|
---|
103 | * (privateConnections.getIamPolicy)
|
---|
104 | *
|
---|
105 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
106 | * requested. See [Resource
|
---|
107 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
108 | * appropriate value for this field.
|
---|
109 | * @param array $optParams Optional parameters.
|
---|
110 | *
|
---|
111 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
112 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
113 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
114 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
115 | * conditional role bindings may specify any valid value or leave the field
|
---|
116 | * unset. The policy in the response might use the policy version that you
|
---|
117 | * specified, or it might use a lower policy version. For example, if you
|
---|
118 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
119 | * response uses version 1. To learn which resources support conditions in their
|
---|
120 | * IAM policies, see the [IAM
|
---|
121 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
122 | * policies).
|
---|
123 | * @return Policy
|
---|
124 | * @throws \Google\Service\Exception
|
---|
125 | */
|
---|
126 | public function getIamPolicy($resource, $optParams = [])
|
---|
127 | {
|
---|
128 | $params = ['resource' => $resource];
|
---|
129 | $params = array_merge($params, $optParams);
|
---|
130 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
131 | }
|
---|
132 | /**
|
---|
133 | * Retrieves a list of private connections in a given project and location.
|
---|
134 | * (privateConnections.listProjectsLocationsPrivateConnections)
|
---|
135 | *
|
---|
136 | * @param string $parent Required. The parent that owns the collection of
|
---|
137 | * private connections.
|
---|
138 | * @param array $optParams Optional parameters.
|
---|
139 | *
|
---|
140 | * @opt_param string filter A filter expression that filters private connections
|
---|
141 | * listed in the response. The expression must specify the field name, a
|
---|
142 | * comparison operator, and the value that you want to use for filtering. The
|
---|
143 | * value must be a string, a number, or a boolean. The comparison operator must
|
---|
144 | * be either =, !=, >, or <. For example, list private connections created this
|
---|
145 | * year by specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**.
|
---|
146 | * @opt_param string orderBy Order by fields for the result.
|
---|
147 | * @opt_param int pageSize Maximum number of private connections to return. If
|
---|
148 | * unspecified, at most 50 private connections that are returned. The maximum
|
---|
149 | * value is 1000; values above 1000 are coerced to 1000.
|
---|
150 | * @opt_param string pageToken Page token received from a previous
|
---|
151 | * `ListPrivateConnections` call. Provide this to retrieve the subsequent page.
|
---|
152 | * When paginating, all other parameters provided to `ListPrivateConnections`
|
---|
153 | * must match the call that provided the page token.
|
---|
154 | * @return ListPrivateConnectionsResponse
|
---|
155 | * @throws \Google\Service\Exception
|
---|
156 | */
|
---|
157 | public function listProjectsLocationsPrivateConnections($parent, $optParams = [])
|
---|
158 | {
|
---|
159 | $params = ['parent' => $parent];
|
---|
160 | $params = array_merge($params, $optParams);
|
---|
161 | return $this->call('list', [$params], ListPrivateConnectionsResponse::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. (privateConnections.setIamPolicy)
|
---|
167 | *
|
---|
168 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
169 | * specified. See [Resource
|
---|
170 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
171 | * appropriate value for this field.
|
---|
172 | * @param SetIamPolicyRequest $postBody
|
---|
173 | * @param array $optParams Optional parameters.
|
---|
174 | * @return Policy
|
---|
175 | * @throws \Google\Service\Exception
|
---|
176 | */
|
---|
177 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
178 | {
|
---|
179 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
180 | $params = array_merge($params, $optParams);
|
---|
181 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
182 | }
|
---|
183 | /**
|
---|
184 | * Returns permissions that a caller has on the specified resource. If the
|
---|
185 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
186 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
187 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
188 | * This operation may "fail open" without warning.
|
---|
189 | * (privateConnections.testIamPermissions)
|
---|
190 | *
|
---|
191 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
192 | * being requested. See [Resource
|
---|
193 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
194 | * appropriate value for this field.
|
---|
195 | * @param TestIamPermissionsRequest $postBody
|
---|
196 | * @param array $optParams Optional parameters.
|
---|
197 | * @return TestIamPermissionsResponse
|
---|
198 | * @throws \Google\Service\Exception
|
---|
199 | */
|
---|
200 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
201 | {
|
---|
202 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
203 | $params = array_merge($params, $optParams);
|
---|
204 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
205 | }
|
---|
206 | }
|
---|
207 |
|
---|
208 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
209 | class_alias(ProjectsLocationsPrivateConnections::class, 'Google_Service_DatabaseMigrationService_Resource_ProjectsLocationsPrivateConnections');
|
---|