PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/google/apiclient-services/src/GKEHub/Resource/ProjectsLocationsMemberships.php

https://gitlab.com/Japang-Jawara/jawara-penilaian
PHP | 283 lines | 68 code | 4 blank | 211 comment | 0 complexity | a17e1e7dfe06d70a103ce7782389aeae 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\GKEHub\Resource;
  18. use Google\Service\GKEHub\GenerateConnectManifestResponse;
  19. use Google\Service\GKEHub\ListMembershipsResponse;
  20. use Google\Service\GKEHub\Membership;
  21. use Google\Service\GKEHub\Operation;
  22. use Google\Service\GKEHub\Policy;
  23. use Google\Service\GKEHub\SetIamPolicyRequest;
  24. use Google\Service\GKEHub\TestIamPermissionsRequest;
  25. use Google\Service\GKEHub\TestIamPermissionsResponse;
  26. /**
  27. * The "memberships" collection of methods.
  28. * Typical usage is:
  29. * <code>
  30. * $gkehubService = new Google\Service\GKEHub(...);
  31. * $memberships = $gkehubService->memberships;
  32. * </code>
  33. */
  34. class ProjectsLocationsMemberships extends \Google\Service\Resource
  35. {
  36. /**
  37. * Creates a new Membership. **This is currently only supported for GKE clusters
  38. * on Google Cloud**. To register other clusters, follow the instructions at
  39. * https://cloud.google.com/anthos/multicluster-
  40. * management/connect/registering-a-cluster. (memberships.create)
  41. *
  42. * @param string $parent Required. The parent (project and location) where the
  43. * Memberships will be created. Specified in the format `projects/locations`.
  44. * @param Membership $postBody
  45. * @param array $optParams Optional parameters.
  46. *
  47. * @opt_param string membershipId Required. Client chosen ID for the membership.
  48. * `membership_id` must be a valid RFC 1123 compliant DNS label: 1. At most 63
  49. * characters in length 2. It must consist of lower case alphanumeric characters
  50. * or `-` 3. It must start and end with an alphanumeric character Which can be
  51. * expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum
  52. * length of 63 characters.
  53. * @opt_param string requestId Optional. A request ID to identify requests.
  54. * Specify a unique request ID so that if you must retry your request, the
  55. * server will know to ignore the request if it has already been completed. The
  56. * server will guarantee that for at least 60 minutes after the first request.
  57. * For example, consider a situation where you make an initial request and the
  58. * request times out. If you make the request again with the same request ID,
  59. * the server can check if original operation with the same request ID was
  60. * received, and if so, will ignore the second request. This prevents clients
  61. * from accidentally creating duplicate commitments. The request ID must be a
  62. * valid UUID with the exception that zero UUID is not supported
  63. * (00000000-0000-0000-0000-000000000000).
  64. * @return Operation
  65. */
  66. public function create($parent, Membership $postBody, $optParams = [])
  67. {
  68. $params = ['parent' => $parent, 'postBody' => $postBody];
  69. $params = array_merge($params, $optParams);
  70. return $this->call('create', [$params], Operation::class);
  71. }
  72. /**
  73. * Removes a Membership. **This is currently only supported for GKE clusters on
  74. * Google Cloud**. To unregister other clusters, follow the instructions at
  75. * https://cloud.google.com/anthos/multicluster-
  76. * management/connect/unregistering-a-cluster. (memberships.delete)
  77. *
  78. * @param string $name Required. The Membership resource name in the format
  79. * `projects/locations/memberships`.
  80. * @param array $optParams Optional parameters.
  81. *
  82. * @opt_param string requestId Optional. A request ID to identify requests.
  83. * Specify a unique request ID so that if you must retry your request, the
  84. * server will know to ignore the request if it has already been completed. The
  85. * server will guarantee that for at least 60 minutes after the first request.
  86. * For example, consider a situation where you make an initial request and the
  87. * request times out. If you make the request again with the same request ID,
  88. * the server can check if original operation with the same request ID was
  89. * received, and if so, will ignore the second request. This prevents clients
  90. * from accidentally creating duplicate commitments. The request ID must be a
  91. * valid UUID with the exception that zero UUID is not supported
  92. * (00000000-0000-0000-0000-000000000000).
  93. * @return Operation
  94. */
  95. public function delete($name, $optParams = [])
  96. {
  97. $params = ['name' => $name];
  98. $params = array_merge($params, $optParams);
  99. return $this->call('delete', [$params], Operation::class);
  100. }
  101. /**
  102. * Generates the manifest for deployment of the GKE connect agent. **This method
  103. * is used internally by Google-provided libraries.** Most clients should not
  104. * need to call this method directly. (memberships.generateConnectManifest)
  105. *
  106. * @param string $name Required. The Membership resource name the Agent will
  107. * associate with, in the format `projects/locations/memberships`.
  108. * @param array $optParams Optional parameters.
  109. *
  110. * @opt_param string imagePullSecretContent Optional. The image pull secret
  111. * content for the registry, if not public.
  112. * @opt_param bool isUpgrade Optional. If true, generate the resources for
  113. * upgrade only. Some resources generated only for installation (e.g. secrets)
  114. * will be excluded.
  115. * @opt_param string namespace Optional. Namespace for GKE Connect agent
  116. * resources. Defaults to `gke-connect`. The Connect Agent is authorized
  117. * automatically when run in the default namespace. Otherwise, explicit
  118. * authorization must be granted with an additional IAM binding.
  119. * @opt_param string proxy Optional. URI of a proxy if connectivity from the
  120. * agent to gkeconnect.googleapis.com requires the use of a proxy. Format must
  121. * be in the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS
  122. * protocol supported by the proxy. This will direct the connect agent's
  123. * outbound traffic through a HTTP(S) proxy.
  124. * @opt_param string registry Optional. The registry to fetch the connect agent
  125. * image from. Defaults to gcr.io/gkeconnect.
  126. * @opt_param string version Optional. The Connect agent version to use.
  127. * Defaults to the most current version.
  128. * @return GenerateConnectManifestResponse
  129. */
  130. public function generateConnectManifest($name, $optParams = [])
  131. {
  132. $params = ['name' => $name];
  133. $params = array_merge($params, $optParams);
  134. return $this->call('generateConnectManifest', [$params], GenerateConnectManifestResponse::class);
  135. }
  136. /**
  137. * Gets the details of a Membership. (memberships.get)
  138. *
  139. * @param string $name Required. The Membership resource name in the format
  140. * `projects/locations/memberships`.
  141. * @param array $optParams Optional parameters.
  142. * @return Membership
  143. */
  144. public function get($name, $optParams = [])
  145. {
  146. $params = ['name' => $name];
  147. $params = array_merge($params, $optParams);
  148. return $this->call('get', [$params], Membership::class);
  149. }
  150. /**
  151. * Gets the access control policy for a resource. Returns an empty policy if the
  152. * resource exists and does not have a policy set. (memberships.getIamPolicy)
  153. *
  154. * @param string $resource REQUIRED: The resource for which the policy is being
  155. * requested. See the operation documentation for the appropriate value for this
  156. * field.
  157. * @param array $optParams Optional parameters.
  158. *
  159. * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
  160. * version that will be used to format the policy. Valid values are 0, 1, and 3.
  161. * Requests specifying an invalid value will be rejected. Requests for policies
  162. * with any conditional role bindings must specify version 3. Policies with no
  163. * conditional role bindings may specify any valid value or leave the field
  164. * unset. The policy in the response might use the policy version that you
  165. * specified, or it might use a lower policy version. For example, if you
  166. * specify version 3, but the policy has no conditional role bindings, the
  167. * response uses version 1. To learn which resources support conditions in their
  168. * IAM policies, see the [IAM
  169. * documentation](https://cloud.google.com/iam/help/conditions/resource-
  170. * policies).
  171. * @return Policy
  172. */
  173. public function getIamPolicy($resource, $optParams = [])
  174. {
  175. $params = ['resource' => $resource];
  176. $params = array_merge($params, $optParams);
  177. return $this->call('getIamPolicy', [$params], Policy::class);
  178. }
  179. /**
  180. * Lists Memberships in a given project and location.
  181. * (memberships.listProjectsLocationsMemberships)
  182. *
  183. * @param string $parent Required. The parent (project and location) where the
  184. * Memberships will be listed. Specified in the format `projects/locations`.
  185. * @param array $optParams Optional parameters.
  186. *
  187. * @opt_param string filter Optional. Lists Memberships that match the filter
  188. * expression, following the syntax outlined in https://google.aip.dev/160.
  189. * Examples: - Name is `bar` in project `foo-proj` and location `global`: name =
  190. * "projects/foo-proj/locations/global/membership/bar" - Memberships that have a
  191. * label called `foo`: labels.foo:* - Memberships that have a label called `foo`
  192. * whose value is `bar`: labels.foo = bar - Memberships in the CREATING state:
  193. * state = CREATING
  194. * @opt_param string orderBy Optional. One or more fields to compare and use to
  195. * sort the output. See https://google.aip.dev/132#ordering.
  196. * @opt_param int pageSize Optional. When requesting a 'page' of resources,
  197. * `page_size` specifies number of resources to return. If unspecified or set to
  198. * 0, all resources will be returned.
  199. * @opt_param string pageToken Optional. Token returned by previous call to
  200. * `ListMemberships` which specifies the position in the list from where to
  201. * continue listing the resources.
  202. * @return ListMembershipsResponse
  203. */
  204. public function listProjectsLocationsMemberships($parent, $optParams = [])
  205. {
  206. $params = ['parent' => $parent];
  207. $params = array_merge($params, $optParams);
  208. return $this->call('list', [$params], ListMembershipsResponse::class);
  209. }
  210. /**
  211. * Updates an existing Membership. (memberships.patch)
  212. *
  213. * @param string $name Required. The Membership resource name in the format
  214. * `projects/locations/memberships`.
  215. * @param Membership $postBody
  216. * @param array $optParams Optional parameters.
  217. *
  218. * @opt_param string requestId Optional. A request ID to identify requests.
  219. * Specify a unique request ID so that if you must retry your request, the
  220. * server will know to ignore the request if it has already been completed. The
  221. * server will guarantee that for at least 60 minutes after the first request.
  222. * For example, consider a situation where you make an initial request and the
  223. * request times out. If you make the request again with the same request ID,
  224. * the server can check if original operation with the same request ID was
  225. * received, and if so, will ignore the second request. This prevents clients
  226. * from accidentally creating duplicate commitments. The request ID must be a
  227. * valid UUID with the exception that zero UUID is not supported
  228. * (00000000-0000-0000-0000-000000000000).
  229. * @opt_param string updateMask Required. Mask of fields to update.
  230. * @return Operation
  231. */
  232. public function patch($name, Membership $postBody, $optParams = [])
  233. {
  234. $params = ['name' => $name, 'postBody' => $postBody];
  235. $params = array_merge($params, $optParams);
  236. return $this->call('patch', [$params], Operation::class);
  237. }
  238. /**
  239. * Sets the access control policy on the specified resource. Replaces any
  240. * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
  241. * `PERMISSION_DENIED` errors. (memberships.setIamPolicy)
  242. *
  243. * @param string $resource REQUIRED: The resource for which the policy is being
  244. * specified. See the operation documentation for the appropriate value for this
  245. * field.
  246. * @param SetIamPolicyRequest $postBody
  247. * @param array $optParams Optional parameters.
  248. * @return Policy
  249. */
  250. public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
  251. {
  252. $params = ['resource' => $resource, 'postBody' => $postBody];
  253. $params = array_merge($params, $optParams);
  254. return $this->call('setIamPolicy', [$params], Policy::class);
  255. }
  256. /**
  257. * Returns permissions that a caller has on the specified resource. If the
  258. * resource does not exist, this will return an empty set of permissions, not a
  259. * `NOT_FOUND` error. Note: This operation is designed to be used for building
  260. * permission-aware UIs and command-line tools, not for authorization checking.
  261. * This operation may "fail open" without warning.
  262. * (memberships.testIamPermissions)
  263. *
  264. * @param string $resource REQUIRED: The resource for which the policy detail is
  265. * being requested. See the operation documentation for the appropriate value
  266. * for this field.
  267. * @param TestIamPermissionsRequest $postBody
  268. * @param array $optParams Optional parameters.
  269. * @return TestIamPermissionsResponse
  270. */
  271. public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
  272. {
  273. $params = ['resource' => $resource, 'postBody' => $postBody];
  274. $params = array_merge($params, $optParams);
  275. return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
  276. }
  277. }
  278. // Adding a class alias for backwards compatibility with the previous class name.
  279. class_alias(ProjectsLocationsMemberships::class, 'Google_Service_GKEHub_Resource_ProjectsLocationsMemberships');