code: def _update_state(self, operation_pb):
          
          if operation_pb.done:
              self._complete = True
  
          if operation_pb.HasField("metadata"):
              self.metadata = _from_any(operation_pb.metadata)
  
          result_type = operation_pb.WhichOneof("result")
          if result_type == "error":
              self.error = operation_pb.error
          elif result_type == "response":
              self.response = _from_any(operation_pb.response)
docs: Update the state of the current object based on operation.
  
          :type operation_pb:
              :class:`~google.longrunning.operations_pb2.Operation`
          :param operation_pb: Protobuf to be parsed.