code: def edit(self, resource):
          
          schema = DeviceSchema(exclude=('id', 'created', 'updated', 'result_id', 'attachments_dir'))
          json = self.service.encode(schema, resource)
  
          schema = DeviceSchema()
          resp = self.service.edit(self.base, resource.id, json)
          return self.service.decode(schema, resp)
docs: Edit a device.
  
          :param resource: :class:`devices.Device <devices.Device>` object
          :return: :class:`devices.Device <devices.Device>` object
          :rtype: devices.Device