Skip to content

Commit 6dacd80

Browse files
feat: add business_contact_email support to Profile API
1 parent d0588c0 commit 6dacd80

2 files changed

Lines changed: 26 additions & 23 deletions

File tree

plivo/resources/profile.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def delete(self, profile_uuid):
5959
alt_business_id_type=[optional(of_type(six.text_type))],
6060
plivo_subaccount=[optional(of_type(six.text_type))],
6161
address=[optional(of_type_exact(dict))],
62-
authorized_contact=[optional(of_type_exact(dict))])
62+
authorized_contact=[optional(of_type_exact(dict))],
63+
business_contact_email=[optional(of_type(six.text_type))])
6364
def create(self,
6465
profile_alias,
6566
customer_type,
@@ -75,13 +76,14 @@ def create(self,
7576
stock_exchange='',
7677
website='',
7778
address={},
78-
authorized_contact={}):
79+
authorized_contact={},
80+
business_contact_email=''):
7981
return self.client.request('POST', ('Profile', ),
8082
to_param_dict(self.create, locals()))
8183

8284

8385
# params values should be dictionary like
84-
# {'address': {}, 'authorized_contact': {}, 'entity_type':'', 'vertical': '', 'company_name': '', 'website':''}
86+
# {'address': {}, 'authorized_contact': {}, 'entity_type':'', 'vertical': '', 'company_name': '', 'website':'', 'business_contact_email':''}
8587
def update(self,profile_uuid, params=None):
8688
if params == None:
8789
raise ValidationError(

tests/resources/test_profile.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,35 @@ class ProfileTest(PlivoResourceTestCase):
66
@with_response(200)
77
def test_create(self):
88
response = self.client.profile.create(
9-
profile_alias="profile name sample",
9+
profile_alias="Test Profile",
1010
customer_type="DIRECT",
11-
entity_type="PRIVATE",
12-
company_name="ABC Inc.",
13-
ein="123456789",
11+
entity_type="PUBLIC",
12+
company_name="Test Company Inc",
13+
ein="12-3456789",
1414
ein_issuing_country="US",
15-
stock_symbol="ABC",
16-
stock_exchange="NSE",
17-
website="www.example.com",
18-
vertical="REAL_ESTATE",
15+
stock_symbol="TEST",
16+
stock_exchange="NASDAQ",
17+
website="https://testcompany.com",
18+
vertical="TECHNOLOGY",
1919
alt_business_id="",
2020
alt_business_id_type="NONE",
21-
plivo_subaccount="123433566",
21+
plivo_subaccount="",
2222
address={
23-
"street": "123",
24-
"city": "New York",
25-
"state": "NY",
26-
"postal_code": "10001",
23+
"street": "123 Main Street",
24+
"city": "San Francisco",
25+
"state": "CA",
26+
"postal_code": "94105",
2727
"country": "US"
2828
},
2929
authorized_contact={
30-
"first_name": "john",
31-
"last_name": "con",
32-
"phone": "1876865565",
33-
"email": "xyz@plivo.com",
34-
"title": "con",
35-
"seniority": "admin"
36-
}
30+
"first_name": "John",
31+
"last_name": "Doe",
32+
"phone": "+14155551234",
33+
"email": "test@example.com",
34+
"title": "CEO",
35+
"seniority": "C_LEVEL"
36+
},
37+
business_contact_email="employee@company.com"
3738
)
3839
self.assertEqual('POST', self.client.current_request.method)
3940
self.assertUrlEqual(

0 commit comments

Comments
 (0)