def put(self, id):
        """**Update a Labor**

        **Example Request:**

        .. sourcecode:: http

            PUT /api/v1/labors/23 HTTP/1.1
            Host: localhost
            Content-Type: application/json

            {
                "questId": 1,
            }

        or

        .. sourcecode:: http

            {
                "ackUser": "johnny"
            }

        **Example response:**

        .. sourcecode:: http

            HTTP/1.1 200 OK
            Content-Type: application/json

            {
                "status": "ok",
                "id": 23,
                "questId": 1,
                "hostId": 26,
                "creationTime": timestamp,
                "targetTime": timestamp,
                "ackTime": timestamp,
                "ackUser": "johnny",
                "completionTime": timestamp,
                "creationEventId": 127,
                "completionEventId": 212,
            }

        :param id: id of the Labor that should be updated.
        :type id: string

        :reqjson int questId: The Quest ID to which this Fate should now be associated.
        :reqjson string ackUser: The username to log as having acknowledged this Labor

        :reqheader Content-Type: The server expects a json body specified with
                                 this header.

        :statuscode 200: The request was successful.
        :statuscode 400: The request was malformed.
        :statuscode 401: The request was made without being logged in.
        :statuscode 403: The request was made with insufficient permissions.
        :statuscode 404: The Labor was not found.
        :statuscode 409: There was a conflict with another resource.
        """

        log.info("LABOR: Update {}".format(id))

        labor = self.session.query(Labor).filter_by(id=id).scalar()
        if not labor:
            raise exc.NotFound("No such Labor {} found".format(id))

        quest_id = None
        ack_user = None
        try:
            if "questId" in self.jbody:
                quest_id = self.jbody["questId"]

            if self.jbody in "ackUser":
                ack_user = self.jbody["ackUser"]
                if not EMAIL_REGEX.match(ack_user):
                    ack_user += "@" + self.domain

            if not quest_id and not ack_user:
                raise exc.BadRequest("Must update either questId or ackUser")
        except KeyError as err:
            raise exc.BadRequest(
                "Missing Required Argument: {}".format(err.message)
            )

        try:
            if quest_id:
                labor.update(quest_id=quest_id)
            if ack_user:
                labor.acknowledge(ack_user)
        except IntegrityError as err:
            raise exc.Conflict(str(err.orig))

        json = labor.to_dict(self.href_prefix)

        self.success(json)

        log.info("LABOR: Updated {}: {} {}".format(
            id,
            "quest is now {}".format(quest_id) if quest_id else "",
            "acked by user {}".format(ack_user) if ack_user else ""
        ))
dataset/ETHPy150Open dropbox/hermes/hermes/handlers/api.py/LaborHandler.put/swapped operands of `in`