@@ -103,6 +103,10 @@ def state(self, value):
103
103
def updated_at (self ):
104
104
return self ._updated_at
105
105
106
+ @property
107
+ def warnings (self ):
108
+ return self ._warnings
109
+
106
110
def _parse_common_tags (self , schedule_xml , ns ):
107
111
if not isinstance (schedule_xml , ET .Element ):
108
112
schedule_xml = ET .fromstring (schedule_xml ).find ('.//t:schedule' , namespaces = ns )
@@ -125,7 +129,7 @@ def _parse_common_tags(self, schedule_xml, ns):
125
129
return self
126
130
127
131
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 ):
129
133
if id_ is not None :
130
134
self ._id = id_
131
135
if name :
@@ -148,6 +152,8 @@ def _set_values(self, id_, name, state, created_at, updated_at, schedule_type,
148
152
self ._priority = priority
149
153
if interval_item :
150
154
self ._interval_item = interval_item
155
+ if warnings :
156
+ self ._warnings = warnings
151
157
152
158
@classmethod
153
159
def from_response (cls , resp , ns ):
@@ -156,6 +162,11 @@ def from_response(cls, resp, ns):
156
162
157
163
@classmethod
158
164
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
+
159
170
all_schedule_items = []
160
171
all_schedule_xml = parsed_response .findall ('.//t:schedule' , namespaces = ns )
161
172
for schedule_xml in all_schedule_xml :
@@ -174,7 +185,8 @@ def from_element(cls, parsed_response, ns):
174
185
end_schedule_at = end_schedule_at ,
175
186
execution_order = None ,
176
187
priority = None ,
177
- interval_item = None )
188
+ interval_item = None ,
189
+ warnings = warnings )
178
190
179
191
all_schedule_items .append (schedule_item )
180
192
return all_schedule_items
0 commit comments