Exemplo n.º 1
0
    print 'Post Status: ' + str(results.status)
    print 'Code: ' + str(results.code)
    print 'Message: ' + str(results.message)
    print 'Results: ' + str(results.results)

    #Asynchronous Soap request to delete DataExtension, Delete method
    #################################################################

    #Explicitly passing the parameter, RequestType & QueuePriority
    deleteDataExtension = ET_DeleteOptions(RequestType, QueuePriority)
    deleteDataExtension.auth_stub = myClient
    dataExtension = ET_DataExtension()
    dataExtension.auth_stub = myClient
    dataExtension.props = {"CustomerKey": "DataExtension_1"}
    dataExtension.delOptions = deleteDataExtension
    results = dataExtension.delete()
    print 'Delete Status: ' + str(results.status)
    print 'Code: ' + str(results.code)
    print 'Message: ' + str(results.message)
    print 'Results: ' + str(results.results)

    # Asynchronous Soap request to add a row , DataExtensionRow POST
    ################################################################

    dataExtensionRow = ET_DataExtension_Row()
    # Explicitly passing the parameter, RequestType and QueuePriority
    createOptions = ET_CreateOptions(RequestType, QueuePriority)
    createOptions.auth_stub = stubObj
    dataExtensionRow.auth_stub = stubObj
    dataExtensionRow.CustomerKey = "CustomerKey"
    dataExtensionRow.props = {
    print 'Post Status: ' + str(results.status)
    print 'Code: ' + str(results.code)
    print 'Message: ' + str(results.message)
    print 'Results: ' + str(results.results)

    #Asynchronous Soap request to delete DataExtension, Delete method
    #################################################################

    #Explicitly passing the parameter, RequestType & QueuePriority
    deleteDataExtension = ET_DeleteOptions(RequestType, QueuePriority)
    deleteDataExtension.auth_stub = myClient
    dataExtension = ET_DataExtension()
    dataExtension.auth_stub = myClient
    dataExtension.props = {"CustomerKey": "DataExtension_1"}
    dataExtension.delOptions = deleteDataExtension
    results = dataExtension.delete()
    print 'Delete Status: ' + str(results.status)
    print 'Code: ' + str(results.code)
    print 'Message: ' + str(results.message)
    print 'Results: ' + str(results.results)

    # Asynchronous Soap request to add a row , DataExtensionRow POST
    ################################################################

    dataExtensionRow = ET_DataExtension_Row()
    # Explicitly passing the parameter, RequestType and QueuePriority
    createOptions = ET_CreateOptions(RequestType, QueuePriority)
    createOptions.auth_stub = stubObj
    dataExtensionRow.auth_stub = stubObj
    dataExtensionRow.CustomerKey = "CustomerKey"
    dataExtensionRow.props = {"Field_1" : "Value_1", "Field_2" : "Value_2", "Field_3" : "Value_3"}
    print 'Results Length: ' + str(len(createDEResponse.results))
    print 'Results: ' + str(createDEResponse.results)

    #Asynchronous Soap request to delete DataExtensions, Delete method

    #Explicitly passing the parameter, RequestType & QueuePriority
    deleteDEOne = ET_DeleteOptions(RequestType, QueuePriority)
    deleteDEOne.auth_stub = myClient
    # Cleaning uprint the newly created DEs
    # Delete deOne
    print '>>> Delete deOne'
    de5 = ET_DataExtension()
    de5.auth_stub = myClient
    de5.props = {"CustomerKey": "HelperDEOne"}
    de5.delOptions = deleteDEOne
    delResponse = de5.delete()
    print 'Delete Status: ' + str(delResponse.status)
    print 'Code: ' + str(delResponse.code)
    print 'Message: ' + str(delResponse.message)
    print 'Results: ' + str(delResponse.results)

    # Delete deTwo
    print '>>> Delete deTwo'
    delet2DE = ET_DeleteOptions(RequestType, QueuePriority)
    delet2DE.auth_stub = myClient
    de5 = ET_DataExtension()
    de5.auth_stub = myClient
    de5.props = {"CustomerKey": "HelperDETwo"}
    de5.delOptions = delet2DE
    delResponse = de5.delete()
    print 'Delete Status: ' + str(delResponse.status)
    print 'Results Length: ' + str(len(createDEResponse.results))
    print 'Results: ' + str(createDEResponse.results)

    #Asynchronous Soap request to delete DataExtensions, Delete method

    #Explicitly passing the parameter, RequestType & QueuePriority
    deleteDEOne = ET_DeleteOptions(RequestType, QueuePriority)
    deleteDEOne.auth_stub = myClient
    # Cleaning uprint the newly created DEs
    # Delete deOne
    print '>>> Delete deOne'
    de5 = ET_DataExtension()
    de5.auth_stub = myClient
    de5.props = {"CustomerKey": "HelperDEOne"}
    de5.delOptions = deleteDEOne
    delResponse = de5.delete()
    print 'Delete Status: ' + str(delResponse.status)
    print 'Code: ' + str(delResponse.code)
    print 'Message: ' + str(delResponse.message)
    print 'Results: ' + str(delResponse.results)

    # Delete deTwo
    print '>>> Delete deTwo'
    delet2DE = ET_DeleteOptions(RequestType, QueuePriority)
    delet2DE.auth_stub = myClient
    de5 = ET_DataExtension()
    de5.auth_stub = myClient
    de5.props = {"CustomerKey": "HelperDETwo"}
    de5.delOptions = delet2DE
    delResponse = de5.delete()
    print 'Delete Status: ' + str(delResponse.status)