From 52f340356921cff065a13515baa223acb43e213c Mon Sep 17 00:00:00 2001 From: Prabhath Nanisetty Date: Mon, 21 Oct 2019 18:02:53 -0500 Subject: [PATCH 1/2] Added Revision/Version XML to bring in optional params API call needs a Revision tag of "1" in order to bring in the optional params. Previously this seems to have been done by default, but now needs to be explicitly called. --- pyusps/address_information.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyusps/address_information.py b/pyusps/address_information.py index bb625cc..dcd836c 100644 --- a/pyusps/address_information.py +++ b/pyusps/address_information.py @@ -131,6 +131,11 @@ def _create_xml( firm_name = arg.get('firm_name', None) urbanization = arg.get('urbanization', None) + # Documentation refers to this as "Version" - it is an option to return all optional data as well + version_el = etree.Element('Revision') + version_el.text = '1' + root.append(version_el) + address_el = etree.Element('Address', ID=str(i)) root.append(address_el) From 99f650a5fb8df8f084bafabdc9f15017ac25c11c Mon Sep 17 00:00:00 2001 From: Prabhath Nanisetty Date: Mon, 21 Oct 2019 20:59:51 -0500 Subject: [PATCH 2/2] fix for multiple addresses --- pyusps/address_information.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyusps/address_information.py b/pyusps/address_information.py index dcd836c..fde8d96 100644 --- a/pyusps/address_information.py +++ b/pyusps/address_information.py @@ -122,6 +122,11 @@ def _create_xml( ) ) + # Documentation refers to this as "Version" - it is an option to return all optional data as well + version_el = etree.Element('Revision') + version_el.text = '1' + root.append(version_el) + for i,arg in enumerate(args): address = arg['address'] city = arg['city'] @@ -130,12 +135,7 @@ def _create_xml( address_extended = arg.get('address_extended', None) firm_name = arg.get('firm_name', None) urbanization = arg.get('urbanization', None) - - # Documentation refers to this as "Version" - it is an option to return all optional data as well - version_el = etree.Element('Revision') - version_el.text = '1' - root.append(version_el) - + address_el = etree.Element('Address', ID=str(i)) root.append(address_el)