code: def on_usb_device_attach(self, device, error, masked_interfaces, capture_filename):
          
          if not isinstance(device, IUSBDevice):
              raise TypeError("device can only be an instance of type IUSBDevice")
          if not isinstance(error, IVirtualBoxErrorInfo):
              raise TypeError("error can only be an instance of type IVirtualBoxErrorInfo")
          if not isinstance(masked_interfaces, baseinteger):
              raise TypeError("masked_interfaces can only be an instance of type baseinteger")
          if not isinstance(capture_filename, basestring):
              raise TypeError("capture_filename can only be an instance of type basestring")
          self._call("onUSBDeviceAttach",
                       in_p=[device, error, masked_interfaces, capture_filename])
docs: Triggered when a request to capture a USB device (as a result
          of matched USB filters or direct call to
          :py:func:`IConsole.attach_usb_device` ) has completed.
          A @c null @a error object means success, otherwise it
          describes a failure.
  
          in device of type :class:`IUSBDevice`
  
          in error of type :class:`IVirtualBoxErrorInfo`
  
          in masked_interfaces of type int
  
          in capture_filename of type str
  
          raises :class:`VBoxErrorInvalidVmState`
              Session state prevents operation.
          
          raises :class:`VBoxErrorInvalidObjectState`
              Session type prevents operation.