PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/vendor/google/apiclient-services/src/Google/Service/ServiceManagement/Resource/Services.php

https://gitlab.com/efabian/maya
PHP | 281 lines | 76 code | 1 blank | 204 comment | 0 complexity | b3209a830b55be50e86235d530da20ac 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. /**
  18. * The "services" collection of methods.
  19. * Typical usage is:
  20. * <code>
  21. * $servicemanagementService = new Google_Service_ServiceManagement(...);
  22. * $services = $servicemanagementService->services;
  23. * </code>
  24. */
  25. class Google_Service_ServiceManagement_Resource_Services extends Google_Service_Resource
  26. {
  27. /**
  28. * Creates a new managed service.
  29. *
  30. * A managed service is immutable, and is subject to mandatory 30-day data
  31. * retention. You cannot move a service or recreate it within 30 days after
  32. * deletion.
  33. *
  34. * One producer project can own no more than 500 services. For security and
  35. * reliability purposes, a production service should be hosted in a dedicated
  36. * producer project.
  37. *
  38. * Operation (services.create)
  39. *
  40. * @param Google_Service_ServiceManagement_ManagedService $postBody
  41. * @param array $optParams Optional parameters.
  42. * @return Google_Service_ServiceManagement_Operation
  43. */
  44. public function create(Google_Service_ServiceManagement_ManagedService $postBody, $optParams = array())
  45. {
  46. $params = array('postBody' => $postBody);
  47. $params = array_merge($params, $optParams);
  48. return $this->call('create', array($params), "Google_Service_ServiceManagement_Operation");
  49. }
  50. /**
  51. * Deletes a managed service. This method will change the service to the `Soft-
  52. * Delete` state for 30 days. Within this period, service producers may call
  53. * UndeleteService to restore the service. After 30 days, the service will be
  54. * permanently deleted.
  55. *
  56. * Operation (services.delete)
  57. *
  58. * @param string $serviceName Required. The name of the service. See the
  59. * [overview](/service-management/overview) for naming requirements. For
  60. * example: `example.googleapis.com`.
  61. * @param array $optParams Optional parameters.
  62. * @return Google_Service_ServiceManagement_Operation
  63. */
  64. public function delete($serviceName, $optParams = array())
  65. {
  66. $params = array('serviceName' => $serviceName);
  67. $params = array_merge($params, $optParams);
  68. return $this->call('delete', array($params), "Google_Service_ServiceManagement_Operation");
  69. }
  70. /**
  71. * Disables a service for a project, so it can no longer be be used for the
  72. * project. It prevents accidental usage that may cause unexpected billing
  73. * charges or security leaks.
  74. *
  75. * Operation (services.disable)
  76. *
  77. * @param string $serviceName Required. Name of the service to disable.
  78. * Specifying an unknown service name will cause the request to fail.
  79. * @param Google_Service_ServiceManagement_DisableServiceRequest $postBody
  80. * @param array $optParams Optional parameters.
  81. * @return Google_Service_ServiceManagement_Operation
  82. */
  83. public function disable($serviceName, Google_Service_ServiceManagement_DisableServiceRequest $postBody, $optParams = array())
  84. {
  85. $params = array('serviceName' => $serviceName, 'postBody' => $postBody);
  86. $params = array_merge($params, $optParams);
  87. return $this->call('disable', array($params), "Google_Service_ServiceManagement_Operation");
  88. }
  89. /**
  90. * Enables a service for a project, so it can be used for the project. See
  91. * [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for more
  92. * information.
  93. *
  94. * Operation (services.enable)
  95. *
  96. * @param string $serviceName Required. Name of the service to enable.
  97. * Specifying an unknown service name will cause the request to fail.
  98. * @param Google_Service_ServiceManagement_EnableServiceRequest $postBody
  99. * @param array $optParams Optional parameters.
  100. * @return Google_Service_ServiceManagement_Operation
  101. */
  102. public function enable($serviceName, Google_Service_ServiceManagement_EnableServiceRequest $postBody, $optParams = array())
  103. {
  104. $params = array('serviceName' => $serviceName, 'postBody' => $postBody);
  105. $params = array_merge($params, $optParams);
  106. return $this->call('enable', array($params), "Google_Service_ServiceManagement_Operation");
  107. }
  108. /**
  109. * Generates and returns a report (errors, warnings and changes from existing
  110. * configurations) associated with GenerateConfigReportRequest.new_value
  111. *
  112. * If GenerateConfigReportRequest.old_value is specified,
  113. * GenerateConfigReportRequest will contain a single ChangeReport based on the
  114. * comparison between GenerateConfigReportRequest.new_value and
  115. * GenerateConfigReportRequest.old_value. If
  116. * GenerateConfigReportRequest.old_value is not specified, this method will
  117. * compare GenerateConfigReportRequest.new_value with the last pushed service
  118. * configuration. (services.generateConfigReport)
  119. *
  120. * @param Google_Service_ServiceManagement_GenerateConfigReportRequest $postBody
  121. * @param array $optParams Optional parameters.
  122. * @return Google_Service_ServiceManagement_GenerateConfigReportResponse
  123. */
  124. public function generateConfigReport(Google_Service_ServiceManagement_GenerateConfigReportRequest $postBody, $optParams = array())
  125. {
  126. $params = array('postBody' => $postBody);
  127. $params = array_merge($params, $optParams);
  128. return $this->call('generateConfigReport', array($params), "Google_Service_ServiceManagement_GenerateConfigReportResponse");
  129. }
  130. /**
  131. * Gets a managed service. Authentication is required unless the service is
  132. * public. (services.get)
  133. *
  134. * @param string $serviceName Required. The name of the service. See the
  135. * `ServiceManager` overview for naming requirements. For example:
  136. * `example.googleapis.com`.
  137. * @param array $optParams Optional parameters.
  138. * @return Google_Service_ServiceManagement_ManagedService
  139. */
  140. public function get($serviceName, $optParams = array())
  141. {
  142. $params = array('serviceName' => $serviceName);
  143. $params = array_merge($params, $optParams);
  144. return $this->call('get', array($params), "Google_Service_ServiceManagement_ManagedService");
  145. }
  146. /**
  147. * Gets a service configuration (version) for a managed service.
  148. * (services.getConfig)
  149. *
  150. * @param string $serviceName Required. The name of the service. See the
  151. * [overview](/service-management/overview) for naming requirements. For
  152. * example: `example.googleapis.com`.
  153. * @param array $optParams Optional parameters.
  154. *
  155. * @opt_param string view Specifies which parts of the Service Config should be
  156. * returned in the response.
  157. * @opt_param string configId Required. The id of the service configuration
  158. * resource.
  159. *
  160. * This field must be specified for the server to return all fields, including
  161. * `SourceInfo`.
  162. * @return Google_Service_ServiceManagement_Service
  163. */
  164. public function getConfig($serviceName, $optParams = array())
  165. {
  166. $params = array('serviceName' => $serviceName);
  167. $params = array_merge($params, $optParams);
  168. return $this->call('getConfig', array($params), "Google_Service_ServiceManagement_Service");
  169. }
  170. /**
  171. * Gets the access control policy for a resource. Returns an empty policy if the
  172. * resource exists and does not have a policy set. (services.getIamPolicy)
  173. *
  174. * @param string $resource REQUIRED: The resource for which the policy is being
  175. * requested. See the operation documentation for the appropriate value for this
  176. * field.
  177. * @param Google_Service_ServiceManagement_GetIamPolicyRequest $postBody
  178. * @param array $optParams Optional parameters.
  179. * @return Google_Service_ServiceManagement_Policy
  180. */
  181. public function getIamPolicy($resource, Google_Service_ServiceManagement_GetIamPolicyRequest $postBody, $optParams = array())
  182. {
  183. $params = array('resource' => $resource, 'postBody' => $postBody);
  184. $params = array_merge($params, $optParams);
  185. return $this->call('getIamPolicy', array($params), "Google_Service_ServiceManagement_Policy");
  186. }
  187. /**
  188. * Lists managed services.
  189. *
  190. * Returns all public services. For authenticated users, also returns all
  191. * services the calling user has "servicemanagement.services.get" permission
  192. * for.
  193. *
  194. * **BETA:** If the caller specifies the `consumer_id`, it returns only the
  195. * services enabled on the consumer. The `consumer_id` must have the format of
  196. * "project:{PROJECT-ID}". (services.listServices)
  197. *
  198. * @param array $optParams Optional parameters.
  199. *
  200. * @opt_param string producerProjectId Include services produced by the
  201. * specified project.
  202. * @opt_param string pageToken Token identifying which result to start with;
  203. * returned by a previous list call.
  204. * @opt_param int pageSize The max number of items to include in the response
  205. * list. Page size is 50 if not specified. Maximum value is 100.
  206. * @opt_param string consumerId Include services consumed by the specified
  207. * consumer.
  208. *
  209. * The Google Service Management implementation accepts the following forms: -
  210. * project:
  211. * @return Google_Service_ServiceManagement_ListServicesResponse
  212. */
  213. public function listServices($optParams = array())
  214. {
  215. $params = array();
  216. $params = array_merge($params, $optParams);
  217. return $this->call('list', array($params), "Google_Service_ServiceManagement_ListServicesResponse");
  218. }
  219. /**
  220. * Sets the access control policy on the specified resource. Replaces any
  221. * existing policy.
  222. *
  223. * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
  224. * (services.setIamPolicy)
  225. *
  226. * @param string $resource REQUIRED: The resource for which the policy is being
  227. * specified. See the operation documentation for the appropriate value for this
  228. * field.
  229. * @param Google_Service_ServiceManagement_SetIamPolicyRequest $postBody
  230. * @param array $optParams Optional parameters.
  231. * @return Google_Service_ServiceManagement_Policy
  232. */
  233. public function setIamPolicy($resource, Google_Service_ServiceManagement_SetIamPolicyRequest $postBody, $optParams = array())
  234. {
  235. $params = array('resource' => $resource, 'postBody' => $postBody);
  236. $params = array_merge($params, $optParams);
  237. return $this->call('setIamPolicy', array($params), "Google_Service_ServiceManagement_Policy");
  238. }
  239. /**
  240. * Returns permissions that a caller has on the specified resource. If the
  241. * resource does not exist, this will return an empty set of permissions, not a
  242. * `NOT_FOUND` error.
  243. *
  244. * Note: This operation is designed to be used for building permission-aware UIs
  245. * and command-line tools, not for authorization checking. This operation may
  246. * "fail open" without warning. (services.testIamPermissions)
  247. *
  248. * @param string $resource REQUIRED: The resource for which the policy detail is
  249. * being requested. See the operation documentation for the appropriate value
  250. * for this field.
  251. * @param Google_Service_ServiceManagement_TestIamPermissionsRequest $postBody
  252. * @param array $optParams Optional parameters.
  253. * @return Google_Service_ServiceManagement_TestIamPermissionsResponse
  254. */
  255. public function testIamPermissions($resource, Google_Service_ServiceManagement_TestIamPermissionsRequest $postBody, $optParams = array())
  256. {
  257. $params = array('resource' => $resource, 'postBody' => $postBody);
  258. $params = array_merge($params, $optParams);
  259. return $this->call('testIamPermissions', array($params), "Google_Service_ServiceManagement_TestIamPermissionsResponse");
  260. }
  261. /**
  262. * Revives a previously deleted managed service. The method restores the service
  263. * using the configuration at the time the service was deleted. The target
  264. * service must exist and must have been deleted within the last 30 days.
  265. *
  266. * Operation (services.undelete)
  267. *
  268. * @param string $serviceName Required. The name of the service. See the
  269. * [overview](/service-management/overview) for naming requirements. For
  270. * example: `example.googleapis.com`.
  271. * @param array $optParams Optional parameters.
  272. * @return Google_Service_ServiceManagement_Operation
  273. */
  274. public function undelete($serviceName, $optParams = array())
  275. {
  276. $params = array('serviceName' => $serviceName);
  277. $params = array_merge($params, $optParams);
  278. return $this->call('undelete', array($params), "Google_Service_ServiceManagement_Operation");
  279. }
  280. }