[e3d4e0a] | 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\ConnectionProfile;
|
---|
| 21 | use Google\Service\DatabaseMigrationService\ListConnectionProfilesResponse;
|
---|
| 22 | use Google\Service\DatabaseMigrationService\Operation;
|
---|
| 23 | use Google\Service\DatabaseMigrationService\Policy;
|
---|
| 24 | use Google\Service\DatabaseMigrationService\SetIamPolicyRequest;
|
---|
| 25 | use Google\Service\DatabaseMigrationService\TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\DatabaseMigrationService\TestIamPermissionsResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "connectionProfiles" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $datamigrationService = new Google\Service\DatabaseMigrationService(...);
|
---|
| 33 | * $connectionProfiles = $datamigrationService->projects_locations_connectionProfiles;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsConnectionProfiles extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Creates a new connection profile in a given project and location.
|
---|
| 40 | * (connectionProfiles.create)
|
---|
| 41 | *
|
---|
| 42 | * @param string $parent Required. The parent which owns this collection of
|
---|
| 43 | * connection profiles.
|
---|
| 44 | * @param ConnectionProfile $postBody
|
---|
| 45 | * @param array $optParams Optional parameters.
|
---|
| 46 | *
|
---|
| 47 | * @opt_param string connectionProfileId Required. The connection profile
|
---|
| 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. Create the connection profile
|
---|
| 55 | * without validating it. The default is false. Only supported for Oracle
|
---|
| 56 | * connection profiles.
|
---|
| 57 | * @opt_param bool validateOnly Optional. Only validate the connection profile,
|
---|
| 58 | * but don't create any resources. The default is false. Only supported for
|
---|
| 59 | * Oracle connection profiles.
|
---|
| 60 | * @return Operation
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function create($parent, ConnectionProfile $postBody, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('create', [$params], Operation::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Deletes a single Database Migration Service connection profile. A connection
|
---|
| 71 | * profile can only be deleted if it is not in use by any active migration jobs.
|
---|
| 72 | * (connectionProfiles.delete)
|
---|
| 73 | *
|
---|
| 74 | * @param string $name Required. Name of the connection profile resource to
|
---|
| 75 | * delete.
|
---|
| 76 | * @param array $optParams Optional parameters.
|
---|
| 77 | *
|
---|
| 78 | * @opt_param bool force In case of force delete, the CloudSQL replica database
|
---|
| 79 | * is also deleted (only for CloudSQL connection profile).
|
---|
| 80 | * @opt_param string requestId A unique ID used to identify the request. If the
|
---|
| 81 | * server receives two requests with the same ID, then the second request is
|
---|
| 82 | * ignored. It is recommended to always set this value to a UUID. The ID must
|
---|
| 83 | * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens
|
---|
| 84 | * (-). The maximum length is 40 characters.
|
---|
| 85 | * @return Operation
|
---|
| 86 | * @throws \Google\Service\Exception
|
---|
| 87 | */
|
---|
| 88 | public function delete($name, $optParams = [])
|
---|
| 89 | {
|
---|
| 90 | $params = ['name' => $name];
|
---|
| 91 | $params = array_merge($params, $optParams);
|
---|
| 92 | return $this->call('delete', [$params], Operation::class);
|
---|
| 93 | }
|
---|
| 94 | /**
|
---|
| 95 | * Gets details of a single connection profile. (connectionProfiles.get)
|
---|
| 96 | *
|
---|
| 97 | * @param string $name Required. Name of the connection profile resource to get.
|
---|
| 98 | * @param array $optParams Optional parameters.
|
---|
| 99 | * @return ConnectionProfile
|
---|
| 100 | * @throws \Google\Service\Exception
|
---|
| 101 | */
|
---|
| 102 | public function get($name, $optParams = [])
|
---|
| 103 | {
|
---|
| 104 | $params = ['name' => $name];
|
---|
| 105 | $params = array_merge($params, $optParams);
|
---|
| 106 | return $this->call('get', [$params], ConnectionProfile::class);
|
---|
| 107 | }
|
---|
| 108 | /**
|
---|
| 109 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 110 | * resource exists and does not have a policy set.
|
---|
| 111 | * (connectionProfiles.getIamPolicy)
|
---|
| 112 | *
|
---|
| 113 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 114 | * requested. See [Resource
|
---|
| 115 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 116 | * appropriate value for this field.
|
---|
| 117 | * @param array $optParams Optional parameters.
|
---|
| 118 | *
|
---|
| 119 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 120 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 121 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 122 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 123 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 124 | * unset. The policy in the response might use the policy version that you
|
---|
| 125 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 126 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 127 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 128 | * IAM policies, see the [IAM
|
---|
| 129 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 130 | * policies).
|
---|
| 131 | * @return Policy
|
---|
| 132 | * @throws \Google\Service\Exception
|
---|
| 133 | */
|
---|
| 134 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 135 | {
|
---|
| 136 | $params = ['resource' => $resource];
|
---|
| 137 | $params = array_merge($params, $optParams);
|
---|
| 138 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 139 | }
|
---|
| 140 | /**
|
---|
| 141 | * Retrieves a list of all connection profiles in a given project and location.
|
---|
| 142 | * (connectionProfiles.listProjectsLocationsConnectionProfiles)
|
---|
| 143 | *
|
---|
| 144 | * @param string $parent Required. The parent which owns this collection of
|
---|
| 145 | * connection profiles.
|
---|
| 146 | * @param array $optParams Optional parameters.
|
---|
| 147 | *
|
---|
| 148 | * @opt_param string filter A filter expression that filters connection profiles
|
---|
| 149 | * listed in the response. The expression must specify the field name, a
|
---|
| 150 | * comparison operator, and the value that you want to use for filtering. The
|
---|
| 151 | * value must be a string, a number, or a boolean. The comparison operator must
|
---|
| 152 | * be either =, !=, >, or <. For example, list connection profiles created this
|
---|
| 153 | * year by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You
|
---|
| 154 | * can also filter nested fields. For example, you could specify
|
---|
| 155 | * **mySql.username = %lt;my_username%gt;** to list all connection profiles
|
---|
| 156 | * configured to connect with a specific username.
|
---|
| 157 | * @opt_param string orderBy A comma-separated list of fields to order results
|
---|
| 158 | * according to.
|
---|
| 159 | * @opt_param int pageSize The maximum number of connection profiles to return.
|
---|
| 160 | * The service may return fewer than this value. If unspecified, at most 50
|
---|
| 161 | * connection profiles will be returned. The maximum value is 1000; values above
|
---|
| 162 | * 1000 are coerced to 1000.
|
---|
| 163 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 164 | * `ListConnectionProfiles` call. Provide this to retrieve the subsequent page.
|
---|
| 165 | * When paginating, all other parameters provided to `ListConnectionProfiles`
|
---|
| 166 | * must match the call that provided the page token.
|
---|
| 167 | * @return ListConnectionProfilesResponse
|
---|
| 168 | * @throws \Google\Service\Exception
|
---|
| 169 | */
|
---|
| 170 | public function listProjectsLocationsConnectionProfiles($parent, $optParams = [])
|
---|
| 171 | {
|
---|
| 172 | $params = ['parent' => $parent];
|
---|
| 173 | $params = array_merge($params, $optParams);
|
---|
| 174 | return $this->call('list', [$params], ListConnectionProfilesResponse::class);
|
---|
| 175 | }
|
---|
| 176 | /**
|
---|
| 177 | * Update the configuration of a single connection profile.
|
---|
| 178 | * (connectionProfiles.patch)
|
---|
| 179 | *
|
---|
| 180 | * @param string $name The name of this connection profile resource in the form
|
---|
| 181 | * of projects/{project}/locations/{location}/connectionProfiles/{connectionProf
|
---|
| 182 | * ile}.
|
---|
| 183 | * @param ConnectionProfile $postBody
|
---|
| 184 | * @param array $optParams Optional parameters.
|
---|
| 185 | *
|
---|
| 186 | * @opt_param string requestId Optional. A unique ID used to identify the
|
---|
| 187 | * request. If the server receives two requests with the same ID, then the
|
---|
| 188 | * second request is ignored. It is recommended to always set this value to a
|
---|
| 189 | * UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
|
---|
| 190 | * (_), and hyphens (-). The maximum length is 40 characters.
|
---|
| 191 | * @opt_param bool skipValidation Optional. Update the connection profile
|
---|
| 192 | * without validating it. The default is false. Only supported for Oracle
|
---|
| 193 | * connection profiles.
|
---|
| 194 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
| 195 | * fields to be overwritten by the update in the conversion workspace resource.
|
---|
| 196 | * @opt_param bool validateOnly Optional. Only validate the connection profile,
|
---|
| 197 | * but don't update any resources. The default is false. Only supported for
|
---|
| 198 | * Oracle connection profiles.
|
---|
| 199 | * @return Operation
|
---|
| 200 | * @throws \Google\Service\Exception
|
---|
| 201 | */
|
---|
| 202 | public function patch($name, ConnectionProfile $postBody, $optParams = [])
|
---|
| 203 | {
|
---|
| 204 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 205 | $params = array_merge($params, $optParams);
|
---|
| 206 | return $this->call('patch', [$params], Operation::class);
|
---|
| 207 | }
|
---|
| 208 | /**
|
---|
| 209 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 210 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 211 | * `PERMISSION_DENIED` errors. (connectionProfiles.setIamPolicy)
|
---|
| 212 | *
|
---|
| 213 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 214 | * specified. See [Resource
|
---|
| 215 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 216 | * appropriate value for this field.
|
---|
| 217 | * @param SetIamPolicyRequest $postBody
|
---|
| 218 | * @param array $optParams Optional parameters.
|
---|
| 219 | * @return Policy
|
---|
| 220 | * @throws \Google\Service\Exception
|
---|
| 221 | */
|
---|
| 222 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 223 | {
|
---|
| 224 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 225 | $params = array_merge($params, $optParams);
|
---|
| 226 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 227 | }
|
---|
| 228 | /**
|
---|
| 229 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 230 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 231 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 232 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 233 | * This operation may "fail open" without warning.
|
---|
| 234 | * (connectionProfiles.testIamPermissions)
|
---|
| 235 | *
|
---|
| 236 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 237 | * being requested. See [Resource
|
---|
| 238 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 239 | * appropriate value for this field.
|
---|
| 240 | * @param TestIamPermissionsRequest $postBody
|
---|
| 241 | * @param array $optParams Optional parameters.
|
---|
| 242 | * @return TestIamPermissionsResponse
|
---|
| 243 | * @throws \Google\Service\Exception
|
---|
| 244 | */
|
---|
| 245 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 246 | {
|
---|
| 247 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 248 | $params = array_merge($params, $optParams);
|
---|
| 249 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 250 | }
|
---|
| 251 | }
|
---|
| 252 |
|
---|
| 253 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 254 | class_alias(ProjectsLocationsConnectionProfiles::class, 'Google_Service_DatabaseMigrationService_Resource_ProjectsLocationsConnectionProfiles');
|
---|