James Shaw's attacker shouted about United Nations during assault

The man who attacked Green Party co-leader James Shaw as he walked to Parliament was shouting his name and mentioned the United Nations.

Shaw, 45, suffered a black eye and a 47-year-old-man will be appear in court on Friday over the incident.

The Diplomatic Protection Squad was on guard duty outside Wellington Hospital on Thursday where the Climate Change Minister was under observation. 

He had no security when he was attacked near the Wellington Botanic Garden Thursday morning on his way to work. 

Prime Minister Jacinda Ardern described it as an "unprovoked, surprising thing to have happened and obviously caught him off guard". 

Green Party co-leader Marama Davidson said her colleague was "shaken", and Deputy Prime Minister Winston Peters said it's "a damned disgrace". 

Shaw's wife Annabel is with him. He has a swollen black eye and a graze on his wrist. In a text sent to Newshub, Shaw said: "It looks worse than it is!"

Shaw said he was worried he'd been kicked on the ground, but after witnesses called an ambulance he was checked and it didn't seem likely. 

Remarkably, he still came to work and attended a ministerial meeting on Thursday morning. 

"He seemed good, but clearly this is an experience that would shake anyone," Finance Minister Grant Robertson said. 

Questions have been raised about whether Shaw was assaulted by someone who knew him. 

Davidson said he was personally identified by the person who attacked him, but said there's no evidence that it was politically motivated. 

"There is nothing at this stage that indicates this attack has anything to do with his work or the Green Party's work," she said. 

But Shaw told ministerial colleagues the attacker yelled about the United Nations. New Zealand supported a controversial United Nations migration pact which was vociferously attacked. 

MPs have been subjected to all sorts of attacks over the years, but rarely as violently as this. Peters confirmed that he has received threats before, and National deputy leader Paula Bennett said also said she's been threatened.

"Probably about three occasions come to mind where I felt like I could have been physically hurt."

The incident has raised serious questions about the safety of our MPs.