The US state of California has filed a lawsuit to block plans to build a wall along the US-Mexican border.