anchor.diff:  		content_types_provided/2,
   		post_is_create/2,
   		create_path/2,
  +		find_subscriber/2,
   		add_subscriber/2]).
   
   -include("ocs_wm.hrl").
  
positive.code: 	ReqData :: rd(), Context :: state()}.
  %% @doc Content negotiation for response body.
  content_types_provided(ReqData, Context) ->
  	case wrq:method(ReqData) of
  		'POST' ->
  			{[{"application/hal+json", add_subscriber}], ReqData, Context};
  		Method when Method == 'GET'; Method == 'HEAD' ->
  			case {wrq:path_info(subscriber, ReqData), wrq:req_qs(ReqData)} of
  				{_, [_|_]} ->
  					{[], ReqData, Context}
  			end
  	end.
  
  
negative.code: 
  	end.
  
  -spec find_subscriber(ReqData :: rd(), Context :: state()) ->
  	{Result :: iodata() | {stream, streambody()} | halt(),
  	 ReqData :: rd(), Context :: state()}.
  %% @doc Body producing function
  find_subscriber(ReqData, Context) ->
  	Name = wrq:path_info(name, ReqData),
  	case ocs:find_subscriber(Name) of
  		{ok, _, Attributes, Balance, _} ->
  			Obj = [{name, Name}, {attributes, Attributes}, {balance, Balance}],
  			JsonObj  = {struct, Obj},
  			Body  = mochijson:encode(JsonObj),
  			{Body, ReqData, Context};
  		{error, _Reason} ->
  			{halt, ReqData, Context}
  	end.
  
  