anchor.diff:                      {false, Req1, State1#base_state{log_msg = Reason}}
               end
       end.
  -
   -spec create_from_json(Req :: #wm_reqdata{}, State :: #base_state{},
  -                       RecType :: chef_object_name(),
  -                       ContainerId ::object_id(), ObjectEjson :: ejson_term()) ->
  +                       RecType :: chef_object_name()| chef_cookbook_version,
  +                       ContainerId ::object_id() | {authz_id, AuthzId::object_id()},
  +                       ObjectEjson :: ejson_term()) ->
                                 {true | {halt, 409 | 500}, #wm_reqdata{}, #base_state{}}.
   %% @doc Implements the from_json callback for POST requests to create Chef
   %% objects. `RecType' is the name of the object record being created
  
positive.code:     %% a 500 and client can retry. If we succeed and the db call fails or conflicts, we can
      %% safely send a delete to solr since this is a new object with a unique ID unknown to
      %% the world.
      ok = chef_object:add_to_solr(TypeName, Id, OrgId,
                                   chef_object:ejson_for_indexing(ObjectRec, ObjectEjson)),
      CreateFun = chef_object:create_fun(ObjectRec),
      case chef_db:CreateFun(DbContext, ObjectRec, ActorId) of
          {conflict, _} ->
              %% ignore return value of solr delete, this is best effort.
              chef_object:delete_from_solr(ObjectRec),
  
              LogMsg = {RecType, name_conflict, Name},
              ConflictMsg = conflict_message(TypeName, Name),
  
negative.code:              State#base_state{log_msg = LogMsg}};
          What ->
              %% ignore return value of solr delete, this is best effort.
              chef_object_db:delete_from_solr(ObjectRec),
              {{halt, 500}, Req, State#base_state{log_msg = What}}
      end.
  
  