/* ****************************************************************************
*
* postUpdateContextAvailabilitySubscription - 
*/
std::string postUpdateContextAvailabilitySubscription
(
  ConnectionInfo*            ciP,
  int                        components,
  std::vector<std::string>&  compV,
  ParseData*                 parseDataP
)
{
  UpdateContextAvailabilitySubscriptionResponse  ucas;
  std::string                                    answer;

  ucas.subscriptionId = parseDataP->ucas.res.subscriptionId;

  // FIXME P6: by the moment, we are assuming that notification will be sent in the same format than the one
  // used to do the subscription, so we are passing ciP->inFomat. This is just an heuristic, the client could want
  // for example to use XML in the subscription message but wants notifications in JSON. We need a more
  // flexible approach, to be implemented
  ciP->httpStatusCode = mongoUpdateContextAvailabilitySubscription(&parseDataP->ucas.res,
                                                                   &ucas,
                                                                   ciP->inFormat,
                                                                   ciP->tenant);

  answer = ucas.render(UpdateContextAvailabilitySubscription, ciP->outFormat, "", 0);

  return answer;
}
/* ****************************************************************************
*
* postUpdateContextAvailabilitySubscription -
*/
std::string postUpdateContextAvailabilitySubscription
(
    ConnectionInfo*            ciP,
    int                        components,
    std::vector<std::string>&  compV,
    ParseData*                 parseDataP
)
{
    UpdateContextAvailabilitySubscriptionResponse  ucas;
    std::string                                    answer;

    ucas.subscriptionId = parseDataP->ucas.res.subscriptionId;

    TIMED_MONGO(ciP->httpStatusCode = mongoUpdateContextAvailabilitySubscription(&parseDataP->ucas.res,
                                      &ucas,
                                      ciP->httpHeaders.correlator,
                                      ciP->tenant));

    TIMED_RENDER(answer = ucas.render(UpdateContextAvailabilitySubscription, "", 0));

    return answer;
}