public function createObjectState($objectStateGroupId, Request $request)
{
$objectStateGroup = $this->objectStateService->loadObjectStateGroup($objectStateGroupId);
try {
$createdObjectState = $this->objectStateService->createObjectState($objectStateGroup, $this->inputDispatcher->parse(new Message(array('Content-Type' => $request->headers->get('Content-Type')), $request->getContent())));
} catch (InvalidArgumentException $e) {
throw new ForbiddenException($e->getMessage());
}
return new Values\CreatedObjectState(array('objectState' => new RestObjectState($createdObjectState, $objectStateGroup->id)));
}