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

/vendor/google/apiclient-services/src/Apigee/Resource/OrganizationsEnvironments.php

https://gitlab.com/Japang-Jawara/jawara-penilaian
PHP | 326 lines | 107 code | 4 blank | 215 comment | 0 complexity | de1f76a0bc98e5966e35331e464e8f39 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\Apigee\Resource;
  18. use Google\Service\Apigee\GoogleCloudApigeeV1DebugMask;
  19. use Google\Service\Apigee\GoogleCloudApigeeV1Environment;
  20. use Google\Service\Apigee\GoogleCloudApigeeV1EnvironmentConfig;
  21. use Google\Service\Apigee\GoogleCloudApigeeV1Subscription;
  22. use Google\Service\Apigee\GoogleCloudApigeeV1TraceConfig;
  23. use Google\Service\Apigee\GoogleIamV1Policy;
  24. use Google\Service\Apigee\GoogleIamV1SetIamPolicyRequest;
  25. use Google\Service\Apigee\GoogleIamV1TestIamPermissionsRequest;
  26. use Google\Service\Apigee\GoogleIamV1TestIamPermissionsResponse;
  27. use Google\Service\Apigee\GoogleLongrunningOperation;
  28. use Google\Service\Apigee\GoogleProtobufEmpty;
  29. /**
  30. * The "environments" collection of methods.
  31. * Typical usage is:
  32. * <code>
  33. * $apigeeService = new Google\Service\Apigee(...);
  34. * $environments = $apigeeService->environments;
  35. * </code>
  36. */
  37. class OrganizationsEnvironments extends \Google\Service\Resource
  38. {
  39. /**
  40. * Creates an environment in an organization. (environments.create)
  41. *
  42. * @param string $parent Required. Name of the organization in which the
  43. * environment will be created. Use the following structure in your request:
  44. * `organizations/{org}`
  45. * @param GoogleCloudApigeeV1Environment $postBody
  46. * @param array $optParams Optional parameters.
  47. *
  48. * @opt_param string name Optional. Name of the environment. Alternatively, the
  49. * name may be specified in the request body in the name field.
  50. * @return GoogleLongrunningOperation
  51. */
  52. public function create($parent, GoogleCloudApigeeV1Environment $postBody, $optParams = [])
  53. {
  54. $params = ['parent' => $parent, 'postBody' => $postBody];
  55. $params = array_merge($params, $optParams);
  56. return $this->call('create', [$params], GoogleLongrunningOperation::class);
  57. }
  58. /**
  59. * Deletes an environment from an organization. (environments.delete)
  60. *
  61. * @param string $name Required. Name of the environment. Use the following
  62. * structure in your request: `organizations/{org}/environments/{env}`
  63. * @param array $optParams Optional parameters.
  64. * @return GoogleLongrunningOperation
  65. */
  66. public function delete($name, $optParams = [])
  67. {
  68. $params = ['name' => $name];
  69. $params = array_merge($params, $optParams);
  70. return $this->call('delete', [$params], GoogleLongrunningOperation::class);
  71. }
  72. /**
  73. * Gets environment details. (environments.get)
  74. *
  75. * @param string $name Required. Name of the environment. Use the following
  76. * structure in your request: `organizations/{org}/environments/{env}`
  77. * @param array $optParams Optional parameters.
  78. * @return GoogleCloudApigeeV1Environment
  79. */
  80. public function get($name, $optParams = [])
  81. {
  82. $params = ['name' => $name];
  83. $params = array_merge($params, $optParams);
  84. return $this->call('get', [$params], GoogleCloudApigeeV1Environment::class);
  85. }
  86. /**
  87. * Gets the debug mask singleton resource for an environment.
  88. * (environments.getDebugmask)
  89. *
  90. * @param string $name Required. Name of the debug mask. Use the following
  91. * structure in your request:
  92. * `organizations/{org}/environments/{env}/debugmask`.
  93. * @param array $optParams Optional parameters.
  94. * @return GoogleCloudApigeeV1DebugMask
  95. */
  96. public function getDebugmask($name, $optParams = [])
  97. {
  98. $params = ['name' => $name];
  99. $params = array_merge($params, $optParams);
  100. return $this->call('getDebugmask', [$params], GoogleCloudApigeeV1DebugMask::class);
  101. }
  102. /**
  103. * Gets the deployed configuration for an environment.
  104. * (environments.getDeployedConfig)
  105. *
  106. * @param string $name Required. Name of the environment deployed configuration
  107. * resource. Use the following structure in your request:
  108. * `organizations/{org}/environments/{env}/deployedConfig`
  109. * @param array $optParams Optional parameters.
  110. * @return GoogleCloudApigeeV1EnvironmentConfig
  111. */
  112. public function getDeployedConfig($name, $optParams = [])
  113. {
  114. $params = ['name' => $name];
  115. $params = array_merge($params, $optParams);
  116. return $this->call('getDeployedConfig', [$params], GoogleCloudApigeeV1EnvironmentConfig::class);
  117. }
  118. /**
  119. * Gets the IAM policy on an environment. For more information, see [Manage
  120. * users, roles, and permissions using the
  121. * API](https://cloud.google.com/apigee/docs/api-platform/system-administration
  122. * /manage-users-roles). You must have the `apigee.environments.getIamPolicy`
  123. * permission to call this API. (environments.getIamPolicy)
  124. *
  125. * @param string $resource REQUIRED: The resource for which the policy is being
  126. * requested. See the operation documentation for the appropriate value for this
  127. * field.
  128. * @param array $optParams Optional parameters.
  129. *
  130. * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
  131. * version that will be used to format the policy. Valid values are 0, 1, and 3.
  132. * Requests specifying an invalid value will be rejected. Requests for policies
  133. * with any conditional role bindings must specify version 3. Policies with no
  134. * conditional role bindings may specify any valid value or leave the field
  135. * unset. The policy in the response might use the policy version that you
  136. * specified, or it might use a lower policy version. For example, if you
  137. * specify version 3, but the policy has no conditional role bindings, the
  138. * response uses version 1. To learn which resources support conditions in their
  139. * IAM policies, see the [IAM
  140. * documentation](https://cloud.google.com/iam/help/conditions/resource-
  141. * policies).
  142. * @return GoogleIamV1Policy
  143. */
  144. public function getIamPolicy($resource, $optParams = [])
  145. {
  146. $params = ['resource' => $resource];
  147. $params = array_merge($params, $optParams);
  148. return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
  149. }
  150. /**
  151. * Get distributed trace configuration in an environment.
  152. * (environments.getTraceConfig)
  153. *
  154. * @param string $name Required. Name of the trace configuration. Use the
  155. * following structure in your request:
  156. * "organizations/environments/traceConfig".
  157. * @param array $optParams Optional parameters.
  158. * @return GoogleCloudApigeeV1TraceConfig
  159. */
  160. public function getTraceConfig($name, $optParams = [])
  161. {
  162. $params = ['name' => $name];
  163. $params = array_merge($params, $optParams);
  164. return $this->call('getTraceConfig', [$params], GoogleCloudApigeeV1TraceConfig::class);
  165. }
  166. /**
  167. * Sets the IAM policy on an environment, if the policy already exists it will
  168. * be replaced. For more information, see [Manage users, roles, and permissions
  169. * using the API](https://cloud.google.com/apigee/docs/api-platform/system-
  170. * administration/manage-users-roles). You must have the
  171. * `apigee.environments.setIamPolicy` permission to call this API.
  172. * (environments.setIamPolicy)
  173. *
  174. * @param string $resource REQUIRED: The resource for which the policy is being
  175. * specified. See the operation documentation for the appropriate value for this
  176. * field.
  177. * @param GoogleIamV1SetIamPolicyRequest $postBody
  178. * @param array $optParams Optional parameters.
  179. * @return GoogleIamV1Policy
  180. */
  181. public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
  182. {
  183. $params = ['resource' => $resource, 'postBody' => $postBody];
  184. $params = array_merge($params, $optParams);
  185. return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
  186. }
  187. /**
  188. * Creates a subscription for the environment's Pub/Sub topic. The server will
  189. * assign a random name for this subscription. The "name" and "push_config" must
  190. * *not* be specified. (environments.subscribe)
  191. *
  192. * @param string $parent Required. Name of the environment. Use the following
  193. * structure in your request: `organizations/{org}/environments/{env}`
  194. * @param array $optParams Optional parameters.
  195. * @return GoogleCloudApigeeV1Subscription
  196. */
  197. public function subscribe($parent, $optParams = [])
  198. {
  199. $params = ['parent' => $parent];
  200. $params = array_merge($params, $optParams);
  201. return $this->call('subscribe', [$params], GoogleCloudApigeeV1Subscription::class);
  202. }
  203. /**
  204. * Tests the permissions of a user on an environment, and returns a subset of
  205. * permissions that the user has on the environment. If the environment does not
  206. * exist, an empty permission set is returned (a NOT_FOUND error is not
  207. * returned). (environments.testIamPermissions)
  208. *
  209. * @param string $resource REQUIRED: The resource for which the policy detail is
  210. * being requested. See the operation documentation for the appropriate value
  211. * for this field.
  212. * @param GoogleIamV1TestIamPermissionsRequest $postBody
  213. * @param array $optParams Optional parameters.
  214. * @return GoogleIamV1TestIamPermissionsResponse
  215. */
  216. public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
  217. {
  218. $params = ['resource' => $resource, 'postBody' => $postBody];
  219. $params = array_merge($params, $optParams);
  220. return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
  221. }
  222. /**
  223. * Deletes a subscription for the environment's Pub/Sub topic.
  224. * (environments.unsubscribe)
  225. *
  226. * @param string $parent Required. Name of the environment. Use the following
  227. * structure in your request: `organizations/{org}/environments/{env}`
  228. * @param GoogleCloudApigeeV1Subscription $postBody
  229. * @param array $optParams Optional parameters.
  230. * @return GoogleProtobufEmpty
  231. */
  232. public function unsubscribe($parent, GoogleCloudApigeeV1Subscription $postBody, $optParams = [])
  233. {
  234. $params = ['parent' => $parent, 'postBody' => $postBody];
  235. $params = array_merge($params, $optParams);
  236. return $this->call('unsubscribe', [$params], GoogleProtobufEmpty::class);
  237. }
  238. /**
  239. * Updates an existing environment. When updating properties, you must pass all
  240. * existing properties to the API, even if they are not being changed. If you
  241. * omit properties from the payload, the properties are removed. To get the
  242. * current list of properties for the environment, use the [Get Environment
  243. * API](get). **Note**: Both `PUT` and `POST` methods are supported for updating
  244. * an existing environment. (environments.update)
  245. *
  246. * @param string $name Required. Name of the environment. Use the following
  247. * structure in your request: `organizations/{org}/environments/{env}`
  248. * @param GoogleCloudApigeeV1Environment $postBody
  249. * @param array $optParams Optional parameters.
  250. * @return GoogleCloudApigeeV1Environment
  251. */
  252. public function update($name, GoogleCloudApigeeV1Environment $postBody, $optParams = [])
  253. {
  254. $params = ['name' => $name, 'postBody' => $postBody];
  255. $params = array_merge($params, $optParams);
  256. return $this->call('update', [$params], GoogleCloudApigeeV1Environment::class);
  257. }
  258. /**
  259. * Updates the debug mask singleton resource for an environment.
  260. * (environments.updateDebugmask)
  261. *
  262. * @param string $name Name of the debug mask.
  263. * @param GoogleCloudApigeeV1DebugMask $postBody
  264. * @param array $optParams Optional parameters.
  265. *
  266. * @opt_param bool replaceRepeatedFields Boolean flag that specifies whether to
  267. * replace existing values in the debug mask when doing an update. Set to true
  268. * to replace existing values. The default behavior is to append the values
  269. * (false).
  270. * @opt_param string updateMask Field debug mask to support partial updates.
  271. * @return GoogleCloudApigeeV1DebugMask
  272. */
  273. public function updateDebugmask($name, GoogleCloudApigeeV1DebugMask $postBody, $optParams = [])
  274. {
  275. $params = ['name' => $name, 'postBody' => $postBody];
  276. $params = array_merge($params, $optParams);
  277. return $this->call('updateDebugmask', [$params], GoogleCloudApigeeV1DebugMask::class);
  278. }
  279. /**
  280. * Updates an existing environment. When updating properties, you must pass all
  281. * existing properties to the API, even if they are not being changed. If you
  282. * omit properties from the payload, the properties are removed. To get the
  283. * current list of properties for the environment, use the [Get Environment
  284. * API](get). **Note**: Both `PUT` and `POST` methods are supported for updating
  285. * an existing environment. (environments.updateEnvironment)
  286. *
  287. * @param string $name Required. Name of the environment. Use the following
  288. * structure in your request: `organizations/{org}/environments/{env}`
  289. * @param GoogleCloudApigeeV1Environment $postBody
  290. * @param array $optParams Optional parameters.
  291. * @return GoogleCloudApigeeV1Environment
  292. */
  293. public function updateEnvironment($name, GoogleCloudApigeeV1Environment $postBody, $optParams = [])
  294. {
  295. $params = ['name' => $name, 'postBody' => $postBody];
  296. $params = array_merge($params, $optParams);
  297. return $this->call('updateEnvironment', [$params], GoogleCloudApigeeV1Environment::class);
  298. }
  299. /**
  300. * Updates the trace configurations in an environment. Note that the repeated
  301. * fields have replace semantics when included in the field mask and that they
  302. * will be overwritten by the value of the fields in the request body.
  303. * (environments.updateTraceConfig)
  304. *
  305. * @param string $name Required. Name of the trace configuration. Use the
  306. * following structure in your request:
  307. * "organizations/environments/traceConfig".
  308. * @param GoogleCloudApigeeV1TraceConfig $postBody
  309. * @param array $optParams Optional parameters.
  310. *
  311. * @opt_param string updateMask List of fields to be updated.
  312. * @return GoogleCloudApigeeV1TraceConfig
  313. */
  314. public function updateTraceConfig($name, GoogleCloudApigeeV1TraceConfig $postBody, $optParams = [])
  315. {
  316. $params = ['name' => $name, 'postBody' => $postBody];
  317. $params = array_merge($params, $optParams);
  318. return $this->call('updateTraceConfig', [$params], GoogleCloudApigeeV1TraceConfig::class);
  319. }
  320. }
  321. // Adding a class alias for backwards compatibility with the previous class name.
  322. class_alias(OrganizationsEnvironments::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironments');