def wns_send_message(uri, message=None, xml_data=None, raw_data=None, **kwargs):
 if message:
  wns_type = 'wns/toast'
  if isinstance(message, str):
   message = {'text': [message]}
  prepared_data = _wns_prepare_toast(data=message, **kwargs)
 elif xml_data:
  xml = dict_to_xml_schema(xml_data)
  wns_type = ('wns/%s' % xml.tag)
  prepared_data = ET.tostring(xml)
 elif raw_data:
  wns_type = 'wns/raw'
  prepared_data = raw_data
 else:
  raise TypeError('At least one of the following parameters must be set:`message`, `xml_data`, `raw_data`')
 _wns_send(uri=uri, data=prepared_data, wns_type=wns_type)

def wns_send_message ( uri , message = None , xml_data = None , raw_data = None , ** kwargs ) : if message : wns_type = 'wns/toast' if isinstance ( message , str ) : message = { 'text' : [ message ] } prepared_data = _wns_prepare_toast ( data = message , ** kwargs ) elif xml_data : xml = dict_to_xml_schema ( xml_data ) wns_type = ( 'wns/%s' % xml . tag ) prepared_data = ET . tostring ( xml ) elif raw_data : wns_type = 'wns/raw' prepared_data = raw_data else : raise TypeError ( 'At least one of the following parameters must be set:`message`, `xml_data`, `raw_data`' ) _wns_send ( uri = uri , data = prepared_data , wns_type = wns_type )
sends a notification request to wns .