source: vendor/google/apiclient-services/src/Dataproc/Resource/ProjectsLocationsAutoscalingPolicies.php@ e3d4e0a

Last change on this file since e3d4e0a was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 9 days ago

Upload project files

  • Property mode set to 100644
File size: 9.6 KB
Line 
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
18namespace Google\Service\Dataproc\Resource;
19
20use Google\Service\Dataproc\AutoscalingPolicy;
21use Google\Service\Dataproc\DataprocEmpty;
22use Google\Service\Dataproc\GetIamPolicyRequest;
23use Google\Service\Dataproc\ListAutoscalingPoliciesResponse;
24use Google\Service\Dataproc\Policy;
25use Google\Service\Dataproc\SetIamPolicyRequest;
26use Google\Service\Dataproc\TestIamPermissionsRequest;
27use Google\Service\Dataproc\TestIamPermissionsResponse;
28
29/**
30 * The "autoscalingPolicies" collection of methods.
31 * Typical usage is:
32 * <code>
33 * $dataprocService = new Google\Service\Dataproc(...);
34 * $autoscalingPolicies = $dataprocService->projects_locations_autoscalingPolicies;
35 * </code>
36 */
37class ProjectsLocationsAutoscalingPolicies extends \Google\Service\Resource
38{
39 /**
40 * Creates new autoscaling policy. (autoscalingPolicies.create)
41 *
42 * @param string $parent Required. The "resource name" of the region or
43 * location, as described in
44 * https://cloud.google.com/apis/design/resource_names. For
45 * projects.regions.autoscalingPolicies.create, the resource name of the region
46 * has the following format: projects/{project_id}/regions/{region} For
47 * projects.locations.autoscalingPolicies.create, the resource name of the
48 * location has the following format: projects/{project_id}/locations/{location}
49 * @param AutoscalingPolicy $postBody
50 * @param array $optParams Optional parameters.
51 * @return AutoscalingPolicy
52 * @throws \Google\Service\Exception
53 */
54 public function create($parent, AutoscalingPolicy $postBody, $optParams = [])
55 {
56 $params = ['parent' => $parent, 'postBody' => $postBody];
57 $params = array_merge($params, $optParams);
58 return $this->call('create', [$params], AutoscalingPolicy::class);
59 }
60 /**
61 * Deletes an autoscaling policy. It is an error to delete an autoscaling policy
62 * that is in use by one or more clusters. (autoscalingPolicies.delete)
63 *
64 * @param string $name Required. The "resource name" of the autoscaling policy,
65 * as described in https://cloud.google.com/apis/design/resource_names. For
66 * projects.regions.autoscalingPolicies.delete, the resource name of the policy
67 * has the following format:
68 * projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For
69 * projects.locations.autoscalingPolicies.delete, the resource name of the
70 * policy has the following format:
71 * projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
72 * @param array $optParams Optional parameters.
73 * @return DataprocEmpty
74 * @throws \Google\Service\Exception
75 */
76 public function delete($name, $optParams = [])
77 {
78 $params = ['name' => $name];
79 $params = array_merge($params, $optParams);
80 return $this->call('delete', [$params], DataprocEmpty::class);
81 }
82 /**
83 * Retrieves autoscaling policy. (autoscalingPolicies.get)
84 *
85 * @param string $name Required. The "resource name" of the autoscaling policy,
86 * as described in https://cloud.google.com/apis/design/resource_names. For
87 * projects.regions.autoscalingPolicies.get, the resource name of the policy has
88 * the following format:
89 * projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For
90 * projects.locations.autoscalingPolicies.get, the resource name of the policy
91 * has the following format:
92 * projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
93 * @param array $optParams Optional parameters.
94 * @return AutoscalingPolicy
95 * @throws \Google\Service\Exception
96 */
97 public function get($name, $optParams = [])
98 {
99 $params = ['name' => $name];
100 $params = array_merge($params, $optParams);
101 return $this->call('get', [$params], AutoscalingPolicy::class);
102 }
103 /**
104 * Gets the access control policy for a resource. Returns an empty policy if the
105 * resource exists and does not have a policy set.
106 * (autoscalingPolicies.getIamPolicy)
107 *
108 * @param string $resource REQUIRED: The resource for which the policy is being
109 * requested. See Resource names
110 * (https://cloud.google.com/apis/design/resource_names) for the appropriate
111 * value for this field.
112 * @param GetIamPolicyRequest $postBody
113 * @param array $optParams Optional parameters.
114 * @return Policy
115 * @throws \Google\Service\Exception
116 */
117 public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
118 {
119 $params = ['resource' => $resource, 'postBody' => $postBody];
120 $params = array_merge($params, $optParams);
121 return $this->call('getIamPolicy', [$params], Policy::class);
122 }
123 /**
124 * Lists autoscaling policies in the project.
125 * (autoscalingPolicies.listProjectsLocationsAutoscalingPolicies)
126 *
127 * @param string $parent Required. The "resource name" of the region or
128 * location, as described in
129 * https://cloud.google.com/apis/design/resource_names. For
130 * projects.regions.autoscalingPolicies.list, the resource name of the region
131 * has the following format: projects/{project_id}/regions/{region} For
132 * projects.locations.autoscalingPolicies.list, the resource name of the
133 * location has the following format: projects/{project_id}/locations/{location}
134 * @param array $optParams Optional parameters.
135 *
136 * @opt_param int pageSize Optional. The maximum number of results to return in
137 * each response. Must be less than or equal to 1000. Defaults to 100.
138 * @opt_param string pageToken Optional. The page token, returned by a previous
139 * call, to request the next page of results.
140 * @return ListAutoscalingPoliciesResponse
141 * @throws \Google\Service\Exception
142 */
143 public function listProjectsLocationsAutoscalingPolicies($parent, $optParams = [])
144 {
145 $params = ['parent' => $parent];
146 $params = array_merge($params, $optParams);
147 return $this->call('list', [$params], ListAutoscalingPoliciesResponse::class);
148 }
149 /**
150 * Sets the access control policy on the specified resource. Replaces any
151 * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
152 * errors. (autoscalingPolicies.setIamPolicy)
153 *
154 * @param string $resource REQUIRED: The resource for which the policy is being
155 * specified. See Resource names
156 * (https://cloud.google.com/apis/design/resource_names) for the appropriate
157 * value for this field.
158 * @param SetIamPolicyRequest $postBody
159 * @param array $optParams Optional parameters.
160 * @return Policy
161 * @throws \Google\Service\Exception
162 */
163 public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
164 {
165 $params = ['resource' => $resource, 'postBody' => $postBody];
166 $params = array_merge($params, $optParams);
167 return $this->call('setIamPolicy', [$params], Policy::class);
168 }
169 /**
170 * Returns permissions that a caller has on the specified resource. If the
171 * resource does not exist, this will return an empty set of permissions, not a
172 * NOT_FOUND error.Note: This operation is designed to be used for building
173 * permission-aware UIs and command-line tools, not for authorization checking.
174 * This operation may "fail open" without warning.
175 * (autoscalingPolicies.testIamPermissions)
176 *
177 * @param string $resource REQUIRED: The resource for which the policy detail is
178 * being requested. See Resource names
179 * (https://cloud.google.com/apis/design/resource_names) for the appropriate
180 * value for this field.
181 * @param TestIamPermissionsRequest $postBody
182 * @param array $optParams Optional parameters.
183 * @return TestIamPermissionsResponse
184 * @throws \Google\Service\Exception
185 */
186 public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
187 {
188 $params = ['resource' => $resource, 'postBody' => $postBody];
189 $params = array_merge($params, $optParams);
190 return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
191 }
192 /**
193 * Updates (replaces) autoscaling policy.Disabled check for update_mask, because
194 * all updates will be full replacements. (autoscalingPolicies.update)
195 *
196 * @param string $name Output only. The "resource name" of the autoscaling
197 * policy, as described in https://cloud.google.com/apis/design/resource_names.
198 * For projects.regions.autoscalingPolicies, the resource name of the policy has
199 * the following format:
200 * projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For
201 * projects.locations.autoscalingPolicies, the resource name of the policy has
202 * the following format:
203 * projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
204 * @param AutoscalingPolicy $postBody
205 * @param array $optParams Optional parameters.
206 * @return AutoscalingPolicy
207 * @throws \Google\Service\Exception
208 */
209 public function update($name, AutoscalingPolicy $postBody, $optParams = [])
210 {
211 $params = ['name' => $name, 'postBody' => $postBody];
212 $params = array_merge($params, $optParams);
213 return $this->call('update', [$params], AutoscalingPolicy::class);
214 }
215}
216
217// Adding a class alias for backwards compatibility with the previous class name.
218class_alias(ProjectsLocationsAutoscalingPolicies::class, 'Google_Service_Dataproc_Resource_ProjectsLocationsAutoscalingPolicies');
Note: See TracBrowser for help on using the repository browser.