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 | namespace Google\Service\ServiceControl\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ServiceControl\CheckRequest;
|
---|
21 | use Google\Service\ServiceControl\CheckResponse;
|
---|
22 | use Google\Service\ServiceControl\ReportRequest;
|
---|
23 | use Google\Service\ServiceControl\ReportResponse;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "services" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $servicecontrolService = new Google\Service\ServiceControl(...);
|
---|
30 | * $services = $servicecontrolService->services;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class Services extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Private Preview. This feature is only available for approved services. This
|
---|
37 | * method provides admission control for services that are integrated with
|
---|
38 | * [Service Infrastructure](https://cloud.google.com/service-infrastructure). It
|
---|
39 | * checks whether an operation should be allowed based on the service
|
---|
40 | * configuration and relevant policies. It must be called before the operation
|
---|
41 | * is executed. For more information, see [Admission
|
---|
42 | * Control](https://cloud.google.com/service-infrastructure/docs/admission-
|
---|
43 | * control). NOTE: The admission control has an expected policy propagation
|
---|
44 | * delay of 60s. The caller **must** not depend on the most recent policy
|
---|
45 | * changes. NOTE: The admission control has a hard limit of 1 referenced
|
---|
46 | * resources per call. If an operation refers to more than 1 resources, the
|
---|
47 | * caller must call the Check method multiple times. This method requires the
|
---|
48 | * `servicemanagement.services.check` permission on the specified service. For
|
---|
49 | * more information, see [Service Control API Access
|
---|
50 | * Control](https://cloud.google.com/service-infrastructure/docs/service-
|
---|
51 | * control/access-control). (services.check)
|
---|
52 | *
|
---|
53 | * @param string $serviceName The service name as specified in its service
|
---|
54 | * configuration. For example, `"pubsub.googleapis.com"`. See
|
---|
55 | * [google.api.Service](https://cloud.google.com/service-
|
---|
56 | * management/reference/rpc/google.api#google.api.Service) for the definition of
|
---|
57 | * a service name.
|
---|
58 | * @param CheckRequest $postBody
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return CheckResponse
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function check($serviceName, CheckRequest $postBody, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['serviceName' => $serviceName, 'postBody' => $postBody];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('check', [$params], CheckResponse::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Private Preview. This feature is only available for approved services. This
|
---|
71 | * method provides telemetry reporting for services that are integrated with
|
---|
72 | * [Service Infrastructure](https://cloud.google.com/service-infrastructure). It
|
---|
73 | * reports a list of operations that have occurred on a service. It must be
|
---|
74 | * called after the operations have been executed. For more information, see
|
---|
75 | * [Telemetry Reporting](https://cloud.google.com/service-
|
---|
76 | * infrastructure/docs/telemetry-reporting). NOTE: The telemetry reporting has a
|
---|
77 | * hard limit of 1000 operations and 1MB per Report call. It is recommended to
|
---|
78 | * have no more than 100 operations per call. This method requires the
|
---|
79 | * `servicemanagement.services.report` permission on the specified service. For
|
---|
80 | * more information, see [Service Control API Access
|
---|
81 | * Control](https://cloud.google.com/service-infrastructure/docs/service-
|
---|
82 | * control/access-control). (services.report)
|
---|
83 | *
|
---|
84 | * @param string $serviceName The service name as specified in its service
|
---|
85 | * configuration. For example, `"pubsub.googleapis.com"`. See
|
---|
86 | * [google.api.Service](https://cloud.google.com/service-
|
---|
87 | * management/reference/rpc/google.api#google.api.Service) for the definition of
|
---|
88 | * a service name.
|
---|
89 | * @param ReportRequest $postBody
|
---|
90 | * @param array $optParams Optional parameters.
|
---|
91 | * @return ReportResponse
|
---|
92 | * @throws \Google\Service\Exception
|
---|
93 | */
|
---|
94 | public function report($serviceName, ReportRequest $postBody, $optParams = [])
|
---|
95 | {
|
---|
96 | $params = ['serviceName' => $serviceName, 'postBody' => $postBody];
|
---|
97 | $params = array_merge($params, $optParams);
|
---|
98 | return $this->call('report', [$params], ReportResponse::class);
|
---|
99 | }
|
---|
100 | }
|
---|
101 |
|
---|
102 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
103 | class_alias(Services::class, 'Google_Service_ServiceControl_Resource_Services');
|
---|