Postmates and Uber have filed a complaint in California federal district court, alleging that a bill limiting how companies can label workers as independent contractors is unconstitutional. The complaint, which includes two gig workers as co-plaintiffs, was filed in U.S. District Court on Monday, days before Assembly Bill 5 (AB-5) is due to go into effect on January 1. It asks for a preliminary injunction against AB-5 while the lawsuit is under consideration.

The complaint argues that AB-5 violates several clauses in the U.S. and California constitutions, including equal protection because of how it classifies gig workers for ridesharing and on-demand delivery companies compared to the exemptions it grants to workers who do “substantively identical work” in more than 20 other industries.

AB-5 was authored by Assemblywoman Lorena Gonzalez, a Democrat representing the 80th Assembly District in southern California and signed into law in September by Governor Gavin Newsom. It is intended to uphold the ruling in Dynamex Operations West Inc. v Superior Court of Los Angeles, a landmark 2018 decision by the California Supreme Court about how employees and independent contractors should be classified, and ensure that gig economy workers are entitled to benefits like minimum wage, health insurance and workers’ compensation.

But the suit’s opponents, which includes tech companies whose business models rely on the gig economy, as well as groups of gig workers and freelance journalists, argue that it restricts their work opportunities and ability to earn money.

In addition to Uber and Postmates, the complaints’ plaintiffs also include Lydia Olson and Miguel Perez, drivers for on-demand companies. In a post on Postmates’ blog, Perez wrote that he joined the suit because AB-5 “is threatening the freedom and flexibility I have relied on in recent years to support my family.”

A statement from Postmates said “AB5 is a blunt instrument, which is why lawmakers exempted 24 industries, seemingly at random, from its requirements.”

The company added that it does not want to be exempted from AB-5 or reverse the Dynamex standard, but “call for industry and labor talks with the California legislature to modernize a robust safety net designed specifically for the needs of on-demand workers, that establishes a new portable benefits model, creates earnings, guarantees higher than minimum wage, and gives all workers both the strong voice they need and flexibility they demand—a framework not currently contemplated under state and federal law.”

As proof that AB-5 violates the equal protection clause, the complaint argues that “the vast majority of the statute is a list of exemptions that carve out of the statutory scope dozens of occupations, including direct salespeople, travel agents, grant writers, construction truck drivers, commercial fisherman, and many more. There is no rhyme or reason to these nonsensical exemptions, and some are so ill-defined or entirely undefined that it is impossible to discern what they include or exclude.”

The complaint also alleges that AB-5 violates due process by preventing people from choosing to work for gig companies, and the contracts clause, because mandating companies like Uber and Postmates to reclassify contractors as employees will either invalidate or substantially change their existing contracts.

In a statement about the lawsuit, Gonzalez said “the one clear thing we know about Uber is they will do anything to try to exempt themselves from state regulations that make us all safer and their driver employees self-sufficient. In the meantime, Uber chief executives will continue to become billionaires while too many of their drivers are forced to sleep in their cars.”

The lawsuit follows several efforts to stop or limit AB-5. In October, a group of drivers for Lyft, Uber and DoorDash announced they had submitted a California ballot initiative for the November 2020 ballot in response to AB-5. The measure, which received substantial financial support from those companies, seeks to enable drivers and couriers to continue to be independent contractors while guaranteeing benefits like a minimum wage, expenses, healthcare and insurances.

Earlier this month, several organizations representing freelancer writers filed a lawsuit in federal court in Los Angeles alleging AB-5 places unconstitutional restrictions on free speech, the day after Vox Media announced it will cut hundreds of freelance positions in California as it prepares for the bill.