PageRenderTime 53ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/google/apiclient-services/src/DatabaseMigrationService/Resource/ProjectsLocationsConnectionProfiles.php

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