@@ -103,6 +103,10 @@ def state(self, value):
103103 def updated_at (self ):
104104 return self ._updated_at
105105
106+ @property
107+ def warnings (self ):
108+ return self ._warnings
109+
106110 def _parse_common_tags (self , schedule_xml , ns ):
107111 if not isinstance (schedule_xml , ET .Element ):
108112 schedule_xml = ET .fromstring (schedule_xml ).find ('.//t:schedule' , namespaces = ns )
@@ -125,7 +129,7 @@ def _parse_common_tags(self, schedule_xml, ns):
125129 return self
126130
127131 def _set_values (self , id_ , name , state , created_at , updated_at , schedule_type ,
128- next_run_at , end_schedule_at , execution_order , priority , interval_item ):
132+ next_run_at , end_schedule_at , execution_order , priority , interval_item , warnings = None ):
129133 if id_ is not None :
130134 self ._id = id_
131135 if name :
@@ -148,6 +152,8 @@ def _set_values(self, id_, name, state, created_at, updated_at, schedule_type,
148152 self ._priority = priority
149153 if interval_item :
150154 self ._interval_item = interval_item
155+ if warnings :
156+ self ._warnings = warnings
151157
152158 @classmethod
153159 def from_response (cls , resp , ns ):
@@ -156,6 +162,11 @@ def from_response(cls, resp, ns):
156162
157163 @classmethod
158164 def from_element (cls , parsed_response , ns ):
165+ all_warning_xml = parsed_response .findall ('.//t:warning' , namespaces = ns )
166+ warnings = list () if len (all_warning_xml ) > 0 else None
167+ for warning_xml in all_warning_xml :
168+ warnings .append (warning_xml .get ('message' , None ))
169+
159170 all_schedule_items = []
160171 all_schedule_xml = parsed_response .findall ('.//t:schedule' , namespaces = ns )
161172 for schedule_xml in all_schedule_xml :
@@ -174,7 +185,8 @@ def from_element(cls, parsed_response, ns):
174185 end_schedule_at = end_schedule_at ,
175186 execution_order = None ,
176187 priority = None ,
177- interval_item = None )
188+ interval_item = None ,
189+ warnings = warnings )
178190
179191 all_schedule_items .append (schedule_item )
180192 return all_schedule_items
0 commit comments