anchor.diff:              {error, time_synchronization,
                <<"TimeSyncronization not allowed in update bucket">>}
       end.
  +
  +assert_candidates(Candidates) ->
  +    %% this is to validate that Candidates elements have specific
  +    %% structure
  +    [case E of
  +         %% ok-s are used to keep correctly parsed/validated params
  +         {ok, _, _} -> [];
  +         %% error-s hold errors
  +         {error, _, _} -> [];
  +         %% ignore-s are used to "do nothing"
  +         ignore -> []
  +     end || E <- Candidates].
   
   validate_bucket_password(undefined) ->
       {error, saslPassword, <<"Bucket password is undefined">>};
  
positive.code: parse_validate_time_synchronization("enabledWithDrift") ->
      {ok, time_synchronization, enabled_with_drift};
  parse_validate_time_synchronization(_Other) ->
      {error, time_synchronization, <<"Time synchronization must be, 'disabled', 'enabledWithDrift', or 'enabledWithoutDrift'">>}.
  
  extended_cluster_storage_info() ->
      [{nodesCount, length(ns_cluster_membership:service_active_nodes(kv))}
  
negative.code:         {ok, X} -> {ok, num_replicas, X}
      end.
  
  parse_validate_replica_index(Params, ReplicasNum, true = _IsNew) ->
      parse_validate_replica_index(
        proplists:get_value("replicaIndex", Params,
                            replicas_num_default(ReplicasNum)));
  parse_validate_replica_index(_Params, _ReplicasNum, false = _IsNew) ->
      ignore.
  
  replicas_num_default({ok, num_replicas, 0}) ->
      "0";
  replicas_num_default(_) ->
      "1".
  
  parse_validate_replica_index("0") -> {ok, replica_index, false};
  parse_validate_replica_index("1") -> {ok, replica_index, true};
  parse_validate_replica_index(_ReplicaValue) -> {error, replicaIndex, <<"replicaIndex can only be 1 or 0">>}.
  
  parse_validate_threads_number(Params, IsNew) ->
      validate_with_missing(proplists:get_value("threadsNumber", Params),
                            "3", IsNew, fun parse_validate_threads_number/1).
  
  parse_validate_flush_enabled("0") -> {ok, flush_enabled, false};
  parse_validate_flush_enabled("1") -> {ok, flush_enabled, true};
  