PageRenderTime 49ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/google/apiclient-services/src/Networkconnectivity/Resource/ProjectsLocationsSpokes.php

https://gitlab.com/Japang-Jawara/jawara-penilaian
PHP | 227 lines | 61 code | 4 blank | 162 comment | 0 complexity | 2b6bd3bea6c07a9dfcbc006a76378054 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\Networkconnectivity\Resource;
  18. use Google\Service\Networkconnectivity\GoogleLongrunningOperation;
  19. use Google\Service\Networkconnectivity\ListSpokesResponse;
  20. use Google\Service\Networkconnectivity\Policy;
  21. use Google\Service\Networkconnectivity\SetIamPolicyRequest;
  22. use Google\Service\Networkconnectivity\Spoke;
  23. use Google\Service\Networkconnectivity\TestIamPermissionsRequest;
  24. use Google\Service\Networkconnectivity\TestIamPermissionsResponse;
  25. /**
  26. * The "spokes" collection of methods.
  27. * Typical usage is:
  28. * <code>
  29. * $networkconnectivityService = new Google\Service\Networkconnectivity(...);
  30. * $spokes = $networkconnectivityService->spokes;
  31. * </code>
  32. */
  33. class ProjectsLocationsSpokes extends \Google\Service\Resource
  34. {
  35. /**
  36. * Creates a spoke in the specified project and location. (spokes.create)
  37. *
  38. * @param string $parent Required. The parent resource.
  39. * @param Spoke $postBody
  40. * @param array $optParams Optional parameters.
  41. *
  42. * @opt_param string requestId Optional. A unique request ID (optional). If you
  43. * specify this ID, you can use it in cases when you need to retry your request.
  44. * When you need to retry, this ID lets the server know that it can ignore the
  45. * request if it has already been completed. The server guarantees that for at
  46. * least 60 minutes after the first request. For example, consider a situation
  47. * where you make an initial request and the request times out. If you make the
  48. * request again with the same request ID, the server can check to see whether
  49. * the original operation was received. If it was, the server ignores the second
  50. * request. This behavior prevents clients from mistakenly creating duplicate
  51. * commitments. The request ID must be a valid UUID, with the exception that
  52. * zero UUID is not supported (00000000-0000-0000-0000-000000000000).
  53. * @opt_param string spokeId Required. Unique id for the spoke to create.
  54. * @return GoogleLongrunningOperation
  55. */
  56. public function create($parent, Spoke $postBody, $optParams = [])
  57. {
  58. $params = ['parent' => $parent, 'postBody' => $postBody];
  59. $params = array_merge($params, $optParams);
  60. return $this->call('create', [$params], GoogleLongrunningOperation::class);
  61. }
  62. /**
  63. * Deletes the specified spoke. (spokes.delete)
  64. *
  65. * @param string $name Required. The name of the spoke to delete.
  66. * @param array $optParams Optional parameters.
  67. *
  68. * @opt_param string requestId Optional. A unique request ID (optional). If you
  69. * specify this ID, you can use it in cases when you need to retry your request.
  70. * When you need to retry, this ID lets the server know that it can ignore the
  71. * request if it has already been completed. The server guarantees that for at
  72. * least 60 minutes after the first request. For example, consider a situation
  73. * where you make an initial request and the request times out. If you make the
  74. * request again with the same request ID, the server can check to see whether
  75. * the original operation was received. If it was, the server ignores the second
  76. * request. This behavior prevents clients from mistakenly creating duplicate
  77. * commitments. The request ID must be a valid UUID, with the exception that
  78. * zero UUID is not supported (00000000-0000-0000-0000-000000000000).
  79. * @return GoogleLongrunningOperation
  80. */
  81. public function delete($name, $optParams = [])
  82. {
  83. $params = ['name' => $name];
  84. $params = array_merge($params, $optParams);
  85. return $this->call('delete', [$params], GoogleLongrunningOperation::class);
  86. }
  87. /**
  88. * Gets details about the specified spoke. (spokes.get)
  89. *
  90. * @param string $name Required. The name of the spoke resource.
  91. * @param array $optParams Optional parameters.
  92. * @return Spoke
  93. */
  94. public function get($name, $optParams = [])
  95. {
  96. $params = ['name' => $name];
  97. $params = array_merge($params, $optParams);
  98. return $this->call('get', [$params], Spoke::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. (spokes.getIamPolicy)
  103. *
  104. * @param string $resource REQUIRED: The resource for which the policy is being
  105. * requested. See the operation documentation for the appropriate value for this
  106. * field.
  107. * @param array $optParams Optional parameters.
  108. *
  109. * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
  110. * version that will be used to format the policy. Valid values are 0, 1, and 3.
  111. * Requests specifying an invalid value will be rejected. Requests for policies
  112. * with any conditional role bindings must specify version 3. Policies with no
  113. * conditional role bindings may specify any valid value or leave the field
  114. * unset. The policy in the response might use the policy version that you
  115. * specified, or it might use a lower policy version. For example, if you
  116. * specify version 3, but the policy has no conditional role bindings, the
  117. * response uses version 1. To learn which resources support conditions in their
  118. * IAM policies, see the [IAM
  119. * documentation](https://cloud.google.com/iam/help/conditions/resource-
  120. * policies).
  121. * @return Policy
  122. */
  123. public function getIamPolicy($resource, $optParams = [])
  124. {
  125. $params = ['resource' => $resource];
  126. $params = array_merge($params, $optParams);
  127. return $this->call('getIamPolicy', [$params], Policy::class);
  128. }
  129. /**
  130. * Lists the spokes in the specified project and location.
  131. * (spokes.listProjectsLocationsSpokes)
  132. *
  133. * @param string $parent Required. The parent resource.
  134. * @param array $optParams Optional parameters.
  135. *
  136. * @opt_param string filter An expression that filters the results listed in the
  137. * response.
  138. * @opt_param string orderBy Sort the results by a certain order.
  139. * @opt_param int pageSize The maximum number of results per page that should be
  140. * returned.
  141. * @opt_param string pageToken The page token.
  142. * @return ListSpokesResponse
  143. */
  144. public function listProjectsLocationsSpokes($parent, $optParams = [])
  145. {
  146. $params = ['parent' => $parent];
  147. $params = array_merge($params, $optParams);
  148. return $this->call('list', [$params], ListSpokesResponse::class);
  149. }
  150. /**
  151. * Updates the parameters of the specified spoke. (spokes.patch)
  152. *
  153. * @param string $name Immutable. The name of the spoke. Spoke names must be
  154. * unique. They use the following form:
  155. * `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
  156. * @param Spoke $postBody
  157. * @param array $optParams Optional parameters.
  158. *
  159. * @opt_param string requestId Optional. A unique request ID (optional). If you
  160. * specify this ID, you can use it in cases when you need to retry your request.
  161. * When you need to retry, this ID lets the server know that it can ignore the
  162. * request if it has already been completed. The server guarantees that for at
  163. * least 60 minutes after the first request. For example, consider a situation
  164. * where you make an initial request and the request times out. If you make the
  165. * request again with the same request ID, the server can check to see whether
  166. * the original operation was received. If it was, the server ignores the second
  167. * request. This behavior prevents clients from mistakenly creating duplicate
  168. * commitments. The request ID must be a valid UUID, with the exception that
  169. * zero UUID is not supported (00000000-0000-0000-0000-000000000000).
  170. * @opt_param string updateMask Optional. In the case of an update to an
  171. * existing spoke, field mask is used to specify the fields to be overwritten.
  172. * The fields specified in the update_mask are relative to the resource, not the
  173. * full request. A field is overwritten if it is in the mask. If the user does
  174. * not provide a mask, then all fields are overwritten.
  175. * @return GoogleLongrunningOperation
  176. */
  177. public function patch($name, Spoke $postBody, $optParams = [])
  178. {
  179. $params = ['name' => $name, 'postBody' => $postBody];
  180. $params = array_merge($params, $optParams);
  181. return $this->call('patch', [$params], GoogleLongrunningOperation::class);
  182. }
  183. /**
  184. * Sets the access control policy on the specified resource. Replaces any
  185. * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
  186. * `PERMISSION_DENIED` errors. (spokes.setIamPolicy)
  187. *
  188. * @param string $resource REQUIRED: The resource for which the policy is being
  189. * specified. See the operation documentation for the appropriate value for this
  190. * field.
  191. * @param SetIamPolicyRequest $postBody
  192. * @param array $optParams Optional parameters.
  193. * @return Policy
  194. */
  195. public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
  196. {
  197. $params = ['resource' => $resource, 'postBody' => $postBody];
  198. $params = array_merge($params, $optParams);
  199. return $this->call('setIamPolicy', [$params], Policy::class);
  200. }
  201. /**
  202. * Returns permissions that a caller has on the specified resource. If the
  203. * resource does not exist, this will return an empty set of permissions, not a
  204. * `NOT_FOUND` error. Note: This operation is designed to be used for building
  205. * permission-aware UIs and command-line tools, not for authorization checking.
  206. * This operation may "fail open" without warning. (spokes.testIamPermissions)
  207. *
  208. * @param string $resource REQUIRED: The resource for which the policy detail is
  209. * being requested. See the operation documentation for the appropriate value
  210. * for this field.
  211. * @param TestIamPermissionsRequest $postBody
  212. * @param array $optParams Optional parameters.
  213. * @return TestIamPermissionsResponse
  214. */
  215. public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
  216. {
  217. $params = ['resource' => $resource, 'postBody' => $postBody];
  218. $params = array_merge($params, $optParams);
  219. return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
  220. }
  221. }
  222. // Adding a class alias for backwards compatibility with the previous class name.
  223. class_alias(ProjectsLocationsSpokes::class, 'Google_Service_Networkconnectivity_Resource_ProjectsLocationsSpokes');