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\CloudRun\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudRun\GoogleCloudRunV2ListServicesResponse;
|
---|
21 | use Google\Service\CloudRun\GoogleCloudRunV2Service;
|
---|
22 | use Google\Service\CloudRun\GoogleIamV1Policy;
|
---|
23 | use Google\Service\CloudRun\GoogleIamV1SetIamPolicyRequest;
|
---|
24 | use Google\Service\CloudRun\GoogleIamV1TestIamPermissionsRequest;
|
---|
25 | use Google\Service\CloudRun\GoogleIamV1TestIamPermissionsResponse;
|
---|
26 | use Google\Service\CloudRun\GoogleLongrunningOperation;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "services" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $runService = new Google\Service\CloudRun(...);
|
---|
33 | * $services = $runService->projects_locations_services;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsServices extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a new Service in a given project and location. (services.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The location and project in which this
|
---|
42 | * service should be created. Format: projects/{project}/locations/{location},
|
---|
43 | * where {project} can be project id or number. Only lowercase characters,
|
---|
44 | * digits, and hyphens.
|
---|
45 | * @param GoogleCloudRunV2Service $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | *
|
---|
48 | * @opt_param string serviceId Required. The unique identifier for the Service.
|
---|
49 | * It must begin with letter, and cannot end with hyphen; must contain fewer
|
---|
50 | * than 50 characters. The name of the service becomes
|
---|
51 | * {parent}/services/{service_id}.
|
---|
52 | * @opt_param bool validateOnly Indicates that the request should be validated
|
---|
53 | * and default values populated, without persisting the request or creating any
|
---|
54 | * resources.
|
---|
55 | * @return GoogleLongrunningOperation
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function create($parent, GoogleCloudRunV2Service $postBody, $optParams = [])
|
---|
59 | {
|
---|
60 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
61 | $params = array_merge($params, $optParams);
|
---|
62 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
63 | }
|
---|
64 | /**
|
---|
65 | * Deletes a Service. This will cause the Service to stop serving traffic and
|
---|
66 | * will delete all revisions. (services.delete)
|
---|
67 | *
|
---|
68 | * @param string $name Required. The full name of the Service. Format:
|
---|
69 | * projects/{project}/locations/{location}/services/{service}, where {project}
|
---|
70 | * can be project id or number.
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | *
|
---|
73 | * @opt_param string etag A system-generated fingerprint for this version of the
|
---|
74 | * resource. May be used to detect modification conflict during updates.
|
---|
75 | * @opt_param bool validateOnly Indicates that the request should be validated
|
---|
76 | * without actually deleting any resources.
|
---|
77 | * @return GoogleLongrunningOperation
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function delete($name, $optParams = [])
|
---|
81 | {
|
---|
82 | $params = ['name' => $name];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
85 | }
|
---|
86 | /**
|
---|
87 | * Gets information about a Service. (services.get)
|
---|
88 | *
|
---|
89 | * @param string $name Required. The full name of the Service. Format:
|
---|
90 | * projects/{project}/locations/{location}/services/{service}, where {project}
|
---|
91 | * can be project id or number.
|
---|
92 | * @param array $optParams Optional parameters.
|
---|
93 | * @return GoogleCloudRunV2Service
|
---|
94 | * @throws \Google\Service\Exception
|
---|
95 | */
|
---|
96 | public function get($name, $optParams = [])
|
---|
97 | {
|
---|
98 | $params = ['name' => $name];
|
---|
99 | $params = array_merge($params, $optParams);
|
---|
100 | return $this->call('get', [$params], GoogleCloudRunV2Service::class);
|
---|
101 | }
|
---|
102 | /**
|
---|
103 | * Gets the IAM Access Control policy currently in effect for the given Cloud
|
---|
104 | * Run Service. This result does not include any inherited policies.
|
---|
105 | * (services.getIamPolicy)
|
---|
106 | *
|
---|
107 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
108 | * requested. See [Resource
|
---|
109 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
110 | * appropriate value for this field.
|
---|
111 | * @param array $optParams Optional parameters.
|
---|
112 | *
|
---|
113 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
114 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
115 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
116 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
117 | * conditional role bindings may specify any valid value or leave the field
|
---|
118 | * unset. The policy in the response might use the policy version that you
|
---|
119 | * specified, or it might use a lower policy version. For example, if you
|
---|
120 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
121 | * response uses version 1. To learn which resources support conditions in their
|
---|
122 | * IAM policies, see the [IAM
|
---|
123 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
124 | * policies).
|
---|
125 | * @return GoogleIamV1Policy
|
---|
126 | * @throws \Google\Service\Exception
|
---|
127 | */
|
---|
128 | public function getIamPolicy($resource, $optParams = [])
|
---|
129 | {
|
---|
130 | $params = ['resource' => $resource];
|
---|
131 | $params = array_merge($params, $optParams);
|
---|
132 | return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
133 | }
|
---|
134 | /**
|
---|
135 | * Lists Services. Results are sorted by creation time, descending.
|
---|
136 | * (services.listProjectsLocationsServices)
|
---|
137 | *
|
---|
138 | * @param string $parent Required. The location and project to list resources
|
---|
139 | * on. Location must be a valid Google Cloud region, and cannot be the "-"
|
---|
140 | * wildcard. Format: projects/{project}/locations/{location}, where {project}
|
---|
141 | * can be project id or number.
|
---|
142 | * @param array $optParams Optional parameters.
|
---|
143 | *
|
---|
144 | * @opt_param int pageSize Maximum number of Services to return in this call.
|
---|
145 | * @opt_param string pageToken A page token received from a previous call to
|
---|
146 | * ListServices. All other parameters must match.
|
---|
147 | * @opt_param bool showDeleted If true, returns deleted (but unexpired)
|
---|
148 | * resources along with active ones.
|
---|
149 | * @return GoogleCloudRunV2ListServicesResponse
|
---|
150 | * @throws \Google\Service\Exception
|
---|
151 | */
|
---|
152 | public function listProjectsLocationsServices($parent, $optParams = [])
|
---|
153 | {
|
---|
154 | $params = ['parent' => $parent];
|
---|
155 | $params = array_merge($params, $optParams);
|
---|
156 | return $this->call('list', [$params], GoogleCloudRunV2ListServicesResponse::class);
|
---|
157 | }
|
---|
158 | /**
|
---|
159 | * Updates a Service. (services.patch)
|
---|
160 | *
|
---|
161 | * @param string $name The fully qualified name of this Service. In
|
---|
162 | * CreateServiceRequest, this field is ignored, and instead composed from
|
---|
163 | * CreateServiceRequest.parent and CreateServiceRequest.service_id. Format:
|
---|
164 | * projects/{project}/locations/{location}/services/{service_id}
|
---|
165 | * @param GoogleCloudRunV2Service $postBody
|
---|
166 | * @param array $optParams Optional parameters.
|
---|
167 | *
|
---|
168 | * @opt_param bool allowMissing Optional. If set to true, and if the Service
|
---|
169 | * does not exist, it will create a new one. The caller must have
|
---|
170 | * 'run.services.create' permissions if this is set to true and the Service does
|
---|
171 | * not exist.
|
---|
172 | * @opt_param string updateMask Optional. The list of fields to be updated.
|
---|
173 | * @opt_param bool validateOnly Indicates that the request should be validated
|
---|
174 | * and default values populated, without persisting the request or updating any
|
---|
175 | * resources.
|
---|
176 | * @return GoogleLongrunningOperation
|
---|
177 | * @throws \Google\Service\Exception
|
---|
178 | */
|
---|
179 | public function patch($name, GoogleCloudRunV2Service $postBody, $optParams = [])
|
---|
180 | {
|
---|
181 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
182 | $params = array_merge($params, $optParams);
|
---|
183 | return $this->call('patch', [$params], GoogleLongrunningOperation::class);
|
---|
184 | }
|
---|
185 | /**
|
---|
186 | * Sets the IAM Access control policy for the specified Service. Overwrites any
|
---|
187 | * existing policy. (services.setIamPolicy)
|
---|
188 | *
|
---|
189 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
190 | * specified. See [Resource
|
---|
191 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
192 | * appropriate value for this field.
|
---|
193 | * @param GoogleIamV1SetIamPolicyRequest $postBody
|
---|
194 | * @param array $optParams Optional parameters.
|
---|
195 | * @return GoogleIamV1Policy
|
---|
196 | * @throws \Google\Service\Exception
|
---|
197 | */
|
---|
198 | public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
|
---|
199 | {
|
---|
200 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
201 | $params = array_merge($params, $optParams);
|
---|
202 | return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
203 | }
|
---|
204 | /**
|
---|
205 | * Returns permissions that a caller has on the specified Project. There are no
|
---|
206 | * permissions required for making this API call. (services.testIamPermissions)
|
---|
207 | *
|
---|
208 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
209 | * being requested. See [Resource
|
---|
210 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
211 | * appropriate value for this field.
|
---|
212 | * @param GoogleIamV1TestIamPermissionsRequest $postBody
|
---|
213 | * @param array $optParams Optional parameters.
|
---|
214 | * @return GoogleIamV1TestIamPermissionsResponse
|
---|
215 | * @throws \Google\Service\Exception
|
---|
216 | */
|
---|
217 | public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
218 | {
|
---|
219 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
220 | $params = array_merge($params, $optParams);
|
---|
221 | return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
|
---|
222 | }
|
---|
223 | }
|
---|
224 |
|
---|
225 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
226 | class_alias(ProjectsLocationsServices::class, 'Google_Service_CloudRun_Resource_ProjectsLocationsServices');
|
---|