|
19 | 19 |
|
20 | 20 | use Google\Service\CloudRun\GoogleCloudRunV2ListWorkerPoolsResponse;
|
21 | 21 | use Google\Service\CloudRun\GoogleCloudRunV2WorkerPool;
|
| 22 | +use Google\Service\CloudRun\GoogleIamV1Policy; |
| 23 | +use Google\Service\CloudRun\GoogleIamV1SetIamPolicyRequest; |
22 | 24 | use Google\Service\CloudRun\GoogleIamV1TestIamPermissionsRequest;
|
23 | 25 | use Google\Service\CloudRun\GoogleIamV1TestIamPermissionsResponse;
|
24 | 26 | use Google\Service\CloudRun\GoogleLongrunningOperation;
|
@@ -97,6 +99,38 @@ public function get($name, $optParams = [])
|
97 | 99 | $params = array_merge($params, $optParams);
|
98 | 100 | return $this->call('get', [$params], GoogleCloudRunV2WorkerPool::class);
|
99 | 101 | }
|
| 102 | + /** |
| 103 | + * Gets the IAM Access Control policy currently in effect for the given Cloud |
| 104 | + * Run WorkerPool. This result does not include any inherited policies. |
| 105 | + * (workerPools.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 | + } |
100 | 134 | /**
|
101 | 135 | * Lists WorkerPools. Results are sorted by creation time, descending.
|
102 | 136 | * (workerPools.listProjectsLocationsWorkerPools)
|
@@ -155,6 +189,25 @@ public function patch($name, GoogleCloudRunV2WorkerPool $postBody, $optParams =
|
155 | 189 | $params = array_merge($params, $optParams);
|
156 | 190 | return $this->call('patch', [$params], GoogleLongrunningOperation::class);
|
157 | 191 | }
|
| 192 | + /** |
| 193 | + * Sets the IAM Access control policy for the specified WorkerPool. Overwrites |
| 194 | + * any existing policy. (workerPools.setIamPolicy) |
| 195 | + * |
| 196 | + * @param string $resource REQUIRED: The resource for which the policy is being |
| 197 | + * specified. See [Resource |
| 198 | + * names](https://cloud.google.com/apis/design/resource_names) for the |
| 199 | + * appropriate value for this field. |
| 200 | + * @param GoogleIamV1SetIamPolicyRequest $postBody |
| 201 | + * @param array $optParams Optional parameters. |
| 202 | + * @return GoogleIamV1Policy |
| 203 | + * @throws \Google\Service\Exception |
| 204 | + */ |
| 205 | + public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = []) |
| 206 | + { |
| 207 | + $params = ['resource' => $resource, 'postBody' => $postBody]; |
| 208 | + $params = array_merge($params, $optParams); |
| 209 | + return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class); |
| 210 | + } |
158 | 211 | /**
|
159 | 212 | * Returns permissions that a caller has on the specified Project. There are no
|
160 | 213 | * permissions required for making this API call.
|
|
0 commit comments