@@ -143,7 +143,7 @@ def __init__(self, auth_stub, obj_type, props = None, update = False, delete = F
143
143
##
144
144
########
145
145
class ET_Get (ET_Constructor ):
146
- def __init__ (self , auth_stub , obj_type , props = None , search_filter = None ):
146
+ def __init__ (self , auth_stub , obj_type , props = None , search_filter = None , options = None ):
147
147
auth_stub .refresh_token ()
148
148
149
149
if props is None : #if there are no properties to retrieve for the obj_type then return a Description of obj_type
@@ -192,6 +192,14 @@ def __init__(self, auth_stub, obj_type, props = None, search_filter = None):
192
192
ws_simpleFilterPart [prop [0 ]] = search_filter [prop [0 ]]
193
193
ws_retrieveRequest .Filter = ws_simpleFilterPart
194
194
195
+ if options is not None :
196
+ for key , value in options .iteritems ():
197
+ if isinstance (value , dict ):
198
+ for k , v in value .iteritems ():
199
+ ws_retrieveRequest .Options [key ][k ] = v
200
+ else :
201
+ ws_retrieveRequest .Options [key ] = value
202
+
195
203
ws_retrieveRequest .ObjectType = obj_type
196
204
197
205
response = auth_stub .soap_client .service .Retrieve (ws_retrieveRequest )
@@ -269,6 +277,7 @@ class ET_BaseObject(object):
269
277
props = None
270
278
extProps = None
271
279
search_filter = None
280
+ options = None
272
281
273
282
########
274
283
##
@@ -278,9 +287,10 @@ class ET_BaseObject(object):
278
287
class ET_GetSupport (ET_BaseObject ):
279
288
obj_type = 'ET_GetSupport' #should be overwritten by inherited class
280
289
281
- def get (self , m_props = None , m_filter = None ):
290
+ def get (self , m_props = None , m_filter = None , m_options = None ):
282
291
props = self .props
283
292
search_filter = self .search_filter
293
+ options = self .options
284
294
285
295
if m_props is not None and type (m_props ) is list :
286
296
props = m_props
@@ -290,7 +300,10 @@ def get(self, m_props = None, m_filter = None):
290
300
if m_filter is not None and type (m_filter ) is dict :
291
301
search_filter = m_filter
292
302
293
- obj = ET_Get (self .auth_stub , self .obj_type , props , search_filter )
303
+ if m_options is not None and type (m_filter ) is dict :
304
+ options = m_options
305
+
306
+ obj = ET_Get (self .auth_stub , self .obj_type , props , search_filter , options )
294
307
if obj is not None :
295
308
self .last_request_id = obj .request_id
296
309
return obj
0 commit comments