Skip to content

Instantly share code, notes, and snippets.

@brianherman
Created June 5, 2015 15:00
Show Gist options
  • Save brianherman/209af7751444ec308e1b to your computer and use it in GitHub Desktop.
Save brianherman/209af7751444ec308e1b to your computer and use it in GitHub Desktop.
Diamond
def New_User(self,policy_id=None, token = None, email=None, password = None, domain=None):
if policy_id:
url2 = "http://uicesv08business/Diamond/BillingService.svc?wsdl"
client = SoapClient112(wsdl=self.URL_billing,ns="tem", cache="cache_billingservice")
if policy_id:
r3 = {
'DiamondSecurityToken': token,
'RequestData': {
'PolicyId': policy_id,
}
# 'DiamondValidation': ...
# 'TestConnectivityOnly': ...
}
try:
resp4=client.GetBillingSummary(**r3)
finally:
pass
clientID = resp4['ResponseData']['BillingSummary']['Summary'][0]['Summary']['m_ClientId']
if policy_id:
client = SoapClient112(wsdl=self.URL_admin ,ns="tem", cache="cache_admin")
if policy_id:
r4 = {
'DiamondSecurityToken': token,
'RequestData': {
'IsNew' : True,
'UserSelected' : False,
'UserLinkRecords': {
'UserLinkBase':{
'IsNew': True,
'UserSelected': False,
'UsersId': -1,
'ClientId': clientID,
},
},
'UsersRecord': {
'IsNew' : True,
'UserSelected': False,
'Active': True,
'LoginDomain': 'uniqueinsuranceco.com',
'LoginName': email,
'Password': password,
'UserCategoryId': 2,
'EmailAddr':email
}
}
}
try:
if token:
resp5=client.SaveUser(**r4)
finally:
pass
return resp5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment