code: def edit(self, resource): # pylint: disable=invalid-name,redefined-builtin
          
          schema = AttachmentSchema(exclude=('id', 'created', 'updated', 'size', 'path', 'device_id'))
          json = self.service.encode(schema, resource)
  
          schema = AttachmentSchema()
          resp = self.service.edit(self._base(resource.device_id), resource.id, json)
          return self.service.decode(schema, resp)
docs: Edit a device's attachment.
  
          :param resource: :class:`attachments.Attachment <attachments.Attachment>` object
          :return: :class:`attachments.Attachment <attachments.Attachment>` object
          :rtype: attachments.Attachment