/**
   * Update the Incident Command Structure work product and optionally associate it with incident by
   * supplying the incident identifier (Interest Group identifier).
   *
   * @param UpdateCommandStructureRequestDocument
   * @return UpdateCommandStructureResponseDocument
   * @see <a href="../../services/IncidentCommand/0.1/IncidentCommandStructure.xsd">Appendix:
   *     IncidentCommandStructure.xsd</a>
   * @see <a href="../../services/IncidentCommand/0.1/OrganizationElement.xsd">Appendix:
   *     OrganizationElement.xsd</a>
   * @idd
   */
  @PayloadRoot(
      namespace = NS_IncidentCommandStructureService,
      localPart = "UpdateCommandStructureRequest")
  public UpdateCommandStructureResponseDocument updateCommandStructure(
      UpdateCommandStructureRequestDocument request) {

    log.debug(request.toString());
    OrganizationElementDocument orgDoc = OrganizationElementDocument.Factory.newInstance();
    orgDoc
        .addNewOrganizationElement()
        .set(request.getUpdateCommandStructureRequest().getOrganizationElement());

    UpdateCommandStructureResponseDocument response =
        UpdateCommandStructureResponseDocument.Factory.newInstance();
    response
        .addNewUpdateCommandStructureResponse()
        .addNewWorkProductPublicationResponse()
        .set(
            WorkProductHelper.toWorkProductPublicationResponse(
                icService.updateCommandStructure(
                    request.getUpdateCommandStructureRequest().getWorkProductIdentification(),
                    orgDoc,
                    request.getUpdateCommandStructureRequest().getIncidentID())));
    return response;
  }
  /**
   * Get the Incident Command Structure work product for a particular incident by supplying the
   * incident identifier (Interest Group identifier).
   *
   * @param GetCommandStructureByIncidentRequestDocument
   * @return GetCommandStructureByIncidentResponseDocument
   * @see <a href="../../services/IncidentCommand/0.1/IncidentCommandStructure.xsd">Appendix:
   *     IncidentCommandStructure.xsd</a>
   * @idd
   */
  @PayloadRoot(
      namespace = NS_IncidentCommandStructureService,
      localPart = "GetCommandStructureByIncidentRequest")
  public GetCommandStructureByIncidentResponseDocument getCommandStructureByIncident(
      GetCommandStructureByIncidentRequestDocument request) {

    GetCommandStructureByIncidentResponseDocument response =
        GetCommandStructureByIncidentResponseDocument.Factory.newInstance();
    response
        .addNewGetCommandStructureByIncidentResponse()
        .setWorkProduct(
            WorkProductHelper.toWorkProduct(
                icService.getCommandStructureByIncident(
                    request.getGetCommandStructureByIncidentRequest())));

    return response;
  }