def _wait_for_operation_to_complete(self, operation_name):
service = self.get_conn()<EOL>while True:<EOL><INDENT>operation_response = service.operations().get(<EOL>name=operation_name,<EOL>).execute(num_retries=self.num_retries)<EOL>if operation_response.get("<STR_LIT>"):<EOL><INDENT>response = operation_response.get("<STR_LIT>")<EOL>error = operation_response.get("<STR_LIT:error>")<EOL>if error:<EOL><INDENT>raise AirflowException(str(error))<EOL><DEDENT>return response<EOL><DEDENT>time.sleep(TIME_TO_SLEEP_IN_SECONDS)<EOL><DEDENT>
Waits for the named operation to complete - checks status of the
asynchronous call.

:param operation_name: The name of the operation.
:type operation_name: str
:return: The response returned by the operation.
:rtype: dict
:exception: AirflowException in case error is returned.