code: def publish(
              self,
              action='get',
              resource=None,
              camera_id=None,
              mode=None,
              publish_response=None,
              properties=None):
          
          url = NOTIFY_ENDPOINT.format(self.device_id)
  
          body = ACTION_BODY.copy()
  
          if properties is None:
              properties = {}
  
          if resource:
              body['resource'] = resource
  
          if action == 'get':
              body['properties'] = None
          else:
              # consider moving this logic up a layer
              if resource == 'schedule':
                  properties.update({'active': True})
              elif resource == 'subscribe':
                  body['resource'] = "subscriptions/" + \
                          "{0}_web".format(self.user_id)
                  dev = []
                  dev.append(self.device_id)
                  properties.update({'devices': dev})
              elif resource == 'modes':
                  available_modes = self.available_modes_with_ids
                  properties.update({'active': available_modes.get(mode)})
              elif resource == 'privacy':
                  properties.update({'privacyActive': not mode})
                  body['resource'] = "cameras/{0}".format(camera_id)
  
          body['action'] = action
          body['properties'] = properties
          body['publishResponse'] = publish_response
  
          body['from'] = "{0}_web".format(self.user_id)
          body['to'] = self.device_id
          body['transId'] = "web!{0}".format(self.xcloud_id)
  
          _LOGGER.debug("Action body: %s", body)
  
          ret = \
              self._session.query(url, method='POST', extra_params=body,
                                  extra_headers={"xCloudId": self.xcloud_id})
  
          if ret and ret.get('success'):
              return 'success'
  
          return None
docs: Run action.
  
          :param method: Specify the method GET, POST or PUT. Default is GET.
          :param resource: Specify one of the resources to fetch from arlo.
          :param camera_id: Specify the camera ID involved with this action
          :param mode: Specify the mode to set, else None for GET operations
          :param publish_response: Set to True for SETs. Default False