, timeout: Optional[float]=None, metadata: Sequence[Tuple[str, Union[str, bytes]]]=(), ) -> operations_pb2.Operation: r"""Call the update worker pool method over HTTP. Args: request (~.gcr_worker_pool.UpdateWorkerPoolRequest): The request object. Request message for updating a worker pool. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type `str`, but for metadata keys ending with the suffix `-bin`, the corresponding values must be of type `bytes`. Returns: ~.operations_pb2.Operation: This resource represents a long-running operation that is the result of a network API call. """ http_options = _BaseWorkerPoolsRestTransport._BaseUpdateWorkerPool._get_http_options() request, metadata = self._interceptor.pre_update_worker_pool(request, metadata) transcoded_request = _BaseWorkerPoolsRestTransport._BaseUpdateWorkerPool._get_transcoded_request(http_options, request) body = _BaseWorkerPoolsRestTransport._BaseUpdateWorkerPool._get_request_body_json(transcoded_request) # Jsonify the query params query_params = _BaseWorkerPoolsRestTransport._BaseUpdateWorkerPool._get_query_params_json(transcoded_request) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] try: request_payload = json_format.MessageToJson(request) except: request_payload = None http_request = { "payload": request_payload, "requestMethod": method, "requestUrl": request_url, "headers": dict(metadata), } _LOGGER.debug( f"Sending request for google.cloud.run_v2.WorkerPoolsClient.UpdateWorkerPool", extra = { "serviceName": "google.cloud.run.v2.WorkerPools", "rpcName": "UpdateWorkerPool", "httpRequest": http_request, "metadata": http_request["headers"], }, ) # Send the request response = WorkerPoolsRestTransport._UpdateWorkerPool._get_response(self._host, metadata, query_params, self._session, timeout, transcoded_request, body) # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception # subclass. if response.status_code >= 400: raise core_exceptions.from_http_response(response) # Return the response resp = operations_pb2.Operation() json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_update_worker_pool(resp) response_metadata = [(k, str(v)) for k, v in response.headers.items()] resp, _ = self._interceptor.post_update_worker_pool_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) except: response_payload = None http_response = { "payload": response_payload, "headers": dict(response.headers), "status": response.status_code, } _LOGGER.debug( "Received response for google.cloud.run_v2.WorkerPoolsClient.update_worker_pool", extra = { "serviceName": "google.cloud.run.v2.WorkerPools", "rpcName": "UpdateWorkerPool", "metadata": http_response["headers"], "httpResponse": http_response, }, ) return resp @property def create_worker_pool(self) -> Callable[ [gcr_worker_pool.CreateWorkerPoolRequest], operations_pb2.Operation]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. # In C++ this would require a dynamic_cast return self._CreateWorkerPool(self._session, self._host, self._interceptor) # type: ignore @property def delete_worker_pool(self) -> Callable[ [worker_pool.DeleteWorkerPoolRequest], operations_pb2.Operation]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. # In C++ this would require a dynamic_cast return self._DeleteWorkerPool(self._session, self._host, self._interceptor) # type: ignore @property def get_iam_policy(self) -> Callable[ [iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. # In C++ this would require a dynamic_cast return self._GetIamPolicy(self._session, self._host, self._interceptor) # type: ignore @property def get_worker_pool(self) -> Callable[ [worker_pool.GetWorkerPoolRequest], worker_pool.WorkerPool]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. # In C++ this would require a dynamic_cast return self._GetWorkerPool(self._session, self._host, self._interceptor) # type: ignore @property def list_worker_pools(self) -> Callable[ [worker_pool.ListWorkerPoolsRequest], worker_pool.ListWorkerPoolsResponse]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. # In C++ this would require a dynamic_cast return self._ListWorkerPools(self._session, self._host, self._interceptor) # type: ignore @property def set_iam_policy(self) -> Callable[ [iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. # In C++ this would require a dynamic_cast return self._SetIamPolicy(self._session, self._host, self._interceptor) # type: ignore @property def test_iam_permissions(self) -> Callable[ [iam_policy_pb2.TestIamPermissionsRequest], iam_policy_pb2.TestIamPermissionsResponse]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. # In C++ this would require a dynamic_cast return self._TestIamPermissions(self._session, self._host, self._interceptor) # type: ignore @property def update_worker_pool(self) -> Callable[ [gcr_worker_pool.UpdateWorkerPoolRequest], operations_pb2.Operation]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. # In C++ this would require a dynamic_cast return self._UpdateWorkerPool(self._session, self._host, self._interceptor) # type: ignore @property def kind(self) -> str: return "rest" def close(self): self._session.close() __all__=( 'WorkerPoolsRestTransport', )