8000 Add support for deleting PropertyDefinitions to FuelSDK. #CIQ-1772 · yurib/FuelSDK-Python@96c58e8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96c58e8

Browse files
author
Randy
committed
Add support for deleting PropertyDefinitions to FuelSDK. #CIQ-1772
1 parent fbaa281 commit 96c58e8

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

FuelSDK/objects.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ class ET_ProfileAttribute():
2929
def __init__(self):
3030
self.obj_type = 'PropertyDefinition'
3131
self.update = False
32+
self.delete = False
3233

3334
def post(self):
34-
obj = ET_Configure(self.auth_stub, self.obj_type, self.props, self.update)
35+
obj = ET_Configure(self.auth_stub, self.obj_type, self.props, self.update, self.delete)
3536
if obj is not None:
3637
self.last_request_id = obj.request_id
3738
return obj

FuelSDK/rest.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,16 @@ def __init__(self, auth_stub, obj_type):
119119
##
120120
########
121121
class ET_Configure(ET_Constructor):
122-
def __init__(self, auth_stub, obj_type, props = None, update = False):
122+
def __init__(self, auth_stub, obj_type, props = None, update = False, delete = False):
123123
auth_stub.refresh_token()
124124

125125
ws_configureRequest = auth_stub.soap_client.factory.create('ConfigureRequestMsg')
126-
ws_configureRequest.Action = 'create' if update is False else 'update'
126+
action = 'create'
127+
if delete:
128+
action = 'delete'
129+
elif update:
130+
action = 'update'
131+
ws_configureRequest.Action = action
127132
ws_configureRequest.Configurations = {'Configuration': self.parse_props_into_ws_object(auth_stub, obj_type, props)}
128133

129134
response = auth_stub.soap_client.service.Configure(None, ws_configureRequest)

0 commit comments

Comments
 (0)
0