@@ -251,9 +251,23 @@ def post(self):
251
251
self .getCustomerKey ()
252
252
originalProps = self .props
253
253
254
- ## FIX THIS
255
254
if type (self .props ) is list :
256
- pass ##THIS SHOULD DO SOMETHING
255
+ currentPropList = []
256
+ for rec in self .props :
257
+ currentFields = []
258
+ currentProp = {}
259
+
260
+ for key , value in rec .iteritems ():
261
+ currentFields .append ({"Name" : key , "Value" : value })
262
+
263
+ currentProp ['CustomerKey' ] = self .CustomerKey
264
+ currentProp ['Properties' ] = {}
265
+ currentProp ['Properties' ]['Property' ] = currentFields
266
+
267
+ currentPropList .append (currentProp )
268
+
269
+ currentProp = currentPropList
270
+
257
271
else :
258
272
currentFields = []
259
273
currentProp = {}
@@ -271,30 +285,66 @@ def post(self):
271
285
272
286
def patch (self ):
273
287
self .getCustomerKey ()
274
- currentFields = []
275
- currentProp = {}
276
-
277
- for key , value in self .props .iteritems ():
278
- currentFields .append ({"Name" : key , "Value" : value })
279
288
280
- currentProp ['CustomerKey' ] = self .CustomerKey
281
- currentProp ['Properties' ] = {}
282
- currentProp ['Properties' ]['Property' ] = currentFields
289
+ if type (self .props ) is list :
290
+ currentPropList = []
291
+ for rec in self .props :
292
+ currentFields = []
293
+ currentProp = {}
294
+
295
+ for key , value in rec .iteritems ():
296
+ currentFields .append ({"Name" : key , "Value" : value })
297
+
298
+ currentProp ['CustomerKey' ] = self .CustomerKey
299
+ currentProp ['Properties' ] = {}
300
+ currentProp ['Properties' ]['Property' ] = currentFields
301
+
302
+ currentPropList .append (currentProp )
303
+
304
+ currentProp = currentPropList
305
+ else :
306
+ currentFields = []
307
+ currentProp = {}
308
+
309
+ for key , value in self .props .iteritems ():
310
+ currentFields .append ({"Name" : key , "Value" : value })
311
+
312
+ currentProp ['CustomerKey' ] = self .CustomerKey
313
+ currentProp ['Properties' ] = {}
314
+ currentProp ['Properties' ]['Property' ] = currentFields
283
315
284
316
obj = ET_Patch (self .auth_stub , self .obj_type , currentProp )
285
317
return obj
286
318
287
319
def delete (self ):
288
320
self .getCustomerKey ()
289
- currentFields = []
290
- currentProp = {}
291
-
292
- for key , value in self .props .iteritems ():
293
- currentFields .append ({"Name" : key , "Value" : value })
294
321
295
- currentProp ['CustomerKey' ] = self .CustomerKey
296
- currentProp ['Keys' ] = {}
297
- currentProp ['Keys' ]['Key' ] = currentFields
322
+ if type (self .props ) is list :
323
+ currentPropList = []
324
+ for rec in self .props :
325
+ currentFields = []
326
+ currentProp = {}
327
+
328
+ for key , value in rec .iteritems ():
329
+ currentFields .append ({"Name" : key , "Value" : value })
330
+
331
+ currentProp ['CustomerKey' ] = self .CustomerKey
332
+ currentProp ['Keys' ] = {}
333
+ currentProp ['Keys' ]['Key' ] = currentFields
334
+
335
+ currentPropList .append (currentProp )
336
+
337
+ currentProp = currentPropList
338
+ else :
339
+ currentFields = []
340
+ currentProp = {}
341
+
342
+ for key , value in self .props .iteritems ():
343
+ currentFields .append ({"Name" : key , "Value" : value })
344
+
345
+ currentProp ['CustomerKey' ] = self .CustomerKey
346
+ currentProp ['Keys' ] = {}
347
+ currentProp ['Keys' ]['Key' ] = currentFields
298
348
299
349
obj = ET_Delete (self .auth_stub , self .obj_type , currentProp )
300
350
return obj
0 commit comments