src/main/java/br/ufpa/labes/spm/web/rest/AgentResource.java
@PutMapping("/agents")
  public ResponseEntity<Agent> updateAgent(@Valid @RequestBody Agent agent)
      throws URISyntaxException {
    log.debug("REST request to update Agent : {}", agent);
    if (agent.getId() == null) {
      throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
    }
    Agent result = agentRepository.save(agent);
    return ResponseEntity.ok()
        .headers(
            HeaderUtil.createEntityUpdateAlert(
                applicationName, true, ENTITY_NAME, agent.getId().toString()))
        .body(result);
  }
/**
   * {@code PUT /agents} : Updates an existing agent.
   *
   * @param agent the agent to update.
   * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated
   *     agent, or with status {@code 400 (Bad Request)} if the agent is not valid, or with status
   *     {@code 500 (Internal Server Error)} if the agent couldn't be updated.
   * @throws URISyntaxException if the Location URI syntax is incorrect.
   */
PUT /agents : Updates an existing agent.
@param agent the agent to update.
@return the  ResponseEntity with status  200 (OK) and with body the updated
agent, or with status  400 (Bad Request) if the agent is not valid, or with status
500 (Internal Server Error) if the agent couldn't be updated.
@throws URISyntaxException if the Location URI syntax is incorrect.
PUT / agents : Updates an existing agent . @param agent the agent to update . @return the ResponseEntity with status 200 ( OK ) and with body the updated agent or with status 400 ( Bad Request ) if the agent is not valid or with status 500 ( Internal Server Error ) if the agent couldn ' t be updated . @throws URISyntaxException if the Location URI syntax is incorrect .
@PutMapping("/agents")
  public ResponseEntity<Agent> updateAgent(@Valid @RequestBody Agent agent)
      throws URISyntaxException {
    log.debug("REST request to update Agent : {}", agent);
    if (agent.getId() == null) {
      throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
    }
    Agent result = agentRepository.save(agent);
    return ResponseEntity.ok()
        .headers(
            HeaderUtil.createEntityUpdateAlert(
                applicationName, true, ENTITY_NAME, agent.getId().toString()))
        .body(result);
  }
@ PutMapping ( "/agents" ) public ResponseEntity < Agent > updateAgent ( @ Valid @ RequestBody Agent agent ) throws URISyntaxException { log . debug ( "REST request to update Agent : {}" , agent ) ; if ( agent . getId ( ) == null ) { throw new BadRequestAlertException ( "Invalid id" , ENTITY_NAME , "idnull" ) ; } Agent result = agentRepository . save ( agent ) ; return ResponseEntity . ok ( ) . headers ( HeaderUtil . createEntityUpdateAlert ( applicationName , true , ENTITY_NAME , agent . getId ( ) . toString ( ) ) ) . body ( result ) ; }
{@code PUT /agents} : Updates an existing agent.
{ @code PUT / agents } : Updates an existing agent .