8000 [Librarian] Regenerated @ 352c12d2f3566583bc444c27197a49bb3ebfbab0 · Santhasangar/twilio-python@8713e09 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8713e09

Browse files
committed
[Librarian] Regenerated @ 352c12d2f3566583bc444c27197a49bb3ebfbab0
1 parent 4ac3fd5 commit 8713e09

File tree

10 files changed

+1592
-71
lines changed

10 files changed

+1592
-71
lines changed

CHANGES.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@ twilio-python Changelog
33

44
Here you can see the full list of changes between each twilio-python release.
55

6+
[2021-11-17] Version 7.3.1
7+
--------------------------
8+
**Library - Fix**
9+
- [PR #578](https://github.com/twilio/twilio-python/pull/578): git log retrieval issues. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
10+
11+
**Frontline**
12+
- Added `is_available` to User's resource
13+
14+
**Messaging**
15+
- Added GET vetting API
16+
17+
**Verify**
18+
- Add `WHATSAPP` to the attempts API.
19+
- Allow to update `config.notification_platform` from `none` to `apn` or `fcm` and viceversa for Verify Push
20+
- Add `none` as a valid `config.notification_platform` value for Verify Push
21+
22+
**Twiml**
23+
- Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
24+
25+
626
[2021-11-03] Version 7.3.0
727
--------------------------
828
**Library - Chore**

tests/integration/frontline_api/v1/test_user.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_fetch_response(self):
3535
"friendly_name": "John Doe",
3636
"avatar": "https://example.com/profile.png",
3737
"state": "active",
38+
"is_available": true,
38< 9E81 code>39
"url": "https://frontline-api.twilio.com/v1/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
3940
}
4041
'''
@@ -65,6 +66,7 @@ def test_update_response(self):
6566
"friendly_name": "John Doe",
6667
"avatar": "https://example.com/profile.png",
6768
"state": "active",
69+
"is_available": true,
6870
"url": "https://frontline-api.twilio.com/v1/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
6971
}
7072
'''

tests/integration/messaging/v1/brand_registration/test_brand_vetting.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,39 @@ def test_read_response(self):
101101
.brand_vettings.list()
102102

103103
self.assertIsNotNone(actual)
104+
105+
def test_fetch_request(self):
106+
self.holodeck.mock(Response(500, ''))
107+
108+
with self.assertRaises(TwilioException):
109+
self.client.messaging.v1.brand_registrations("BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
110+
.brand_vettings("VTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()
111+
112+
self.holodeck.assert_has_request(Request(
113+
'get',
114+
'https://messaging.twilio.com/v1/a2p/BrandRegistrations/BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Vettings/VTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
115+
))
116+
117+
def test_fetch_response(self):
118+
self.holodeck.mock(Response(
119+
200,
120+
'''
121+
{
122+
"account_sid": "AC78e8e67fc0246521490fb9907fd0c165",
123+
"brand_sid": "BN0044409f7e067e279523808d267e2d85",
124+
"brand_vetting_sid": "VT12445353",
125+
"vetting_provider": "campaign-verify",
126+
"vetting_id": "cv|1.0|tcr|10dlc|9975c339-d46f-49b7-a399-EXAMPLETOKEN|GQ3EXAMPLETOKENAXXBUNBT2AgL-LdQuPveFhEyY",
127+
"vetting_class": "POLITICAL",
128+
"vetting_status": "IN_PROGRESS",
129+
"date_created": "2021-01-27T14:18:35Z",
130+
"date_updated": "2021-01-27T14:18:35Z",
131+
"url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85/Vettings/VT12445353"
132+
}
133+
'''
134+
))
135+
136+
actual = self.client.messaging.v1.brand_registrations("BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
137+
.brand_vettings("VTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()
138+
139+
self.assertIsNotNone(actual)

twilio/rest/api/v2010/account/call/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def create(self, to, from_, method=values.unset, fallback_url=values.unset,
9696
:param unicode async_amd_status_callback_method: HTTP Method to use with async_amd_status_callback
9797
:param unicode byoc: BYOC trunk SID (Beta)
9898
:param unicode call_reason: Reason for the call (Branded Calls Beta)
99-
:param unicode call_token: A token string needed to invoke a forwarded call with a caller-id recieved on a previous incoming call
99+
:param unicode call_token: A token string needed to invoke a forwarded call with a CallerId recieved on a previous incoming call
100100
:param unicode recording_track: Which track(s) to record
101101
:param unicode time_limit: The maximum duration of the call in seconds.
102102
:param unicode url: The absolute URL that returns TwiML for this call

10000 twilio/rest/frontline_api/v1/user.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,24 @@ def fetch(self):
135135
return UserInstance(self._version, payload, sid=self._solution['sid'], )
136136

137137
def update(self, friendly_name=values.unset, avatar=values.unset,
138-
state=values.unset):
138+
state=values.unset, is_available=values.unset):
139139
"""
140140
Update the UserInstance
141141
142142
:param unicode friendly_name: The string that you assigned to describe the User
143143
:param unicode avatar: The avatar URL which will be shown in Frontline application
144144
:param UserInstance.StateType state: Current state of this user
145+
:param bool is_available: Whether the User is available for new conversations
145146
146147
:returns: The updated UserInstance
147148
:rtype: twilio.rest.frontline_api.v1.user.UserInstance
148149
"""
149-
data = values.of({'FriendlyName': friendly_name, 'Avatar': avatar, 'State': state, })
150+
data = values.of({
151+
'FriendlyName': friendly_name,
152+
'Avatar': avatar,
153+
'State': state,
154+
'IsAvailable': is_available,
155+
})
150156

151157
payload = self._version.update(method='POST', uri=self._uri, data=data, )
152158

@@ -187,6 +193,7 @@ def __init__(self, version, payload, sid=None):
187193
'friendly_name': payload.get('friendly_name'),
188194
'avatar': payload.get('avatar'),
189195
'state': payload.get('state'),
196+
'is_available': payload.get('is_available'),
190197
'url': payload.get('url'),
191198
}
192199

@@ -247,6 +254,14 @@ def state(self):
247254
"""
248255
return self._properties['state']
249256

257+
@property
258+
def is_available(self):
259+
"""
260+
:returns: Whether the User is available for new conversations
261+
:rtype: bool
262+
"""
263+
return self._properties['is_available']
264+
250265
@property
251266
def url(self):
252267
"""
@@ -265,18 +280,24 @@ def fetch(self):
265280
return self._proxy.fetch()
266281

267282
def update(self, friendly_name=values.unset, avatar=values.unset,
268-
state=values.unset):
283+
state=values.unset, is_available=values.unset):
269284
"""
270285
Update the UserInstance
271286
272287
:param unicode friendly_name: The string that you assigned to describe the User
273288
:param unicode avatar: The avatar URL which will be shown in Frontline application
274289
:param UserInstance.StateType state: Current state of this user
290+
:param bool is_available: Whether the User is available for new conversations
275291
276292
:returns: The updated UserInstance
277293
:rtype: twilio.rest.frontline_api.v1.user.UserInstance
278294
"""
279-
return self._proxy.update(friendly_name=friendly_name, avatar=avatar, state=state, )
295+
return self._proxy.update(
296+
friendly_name=friendly_name,
297+
avatar=avatar,
298+
state=state,
299+
is_available=is_available,
300+
)
280301

281302
def __repr__(self):
282303
"""

twilio/rest/messaging/v1/brand_registration/brand_vetting.py

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from twilio.base import deserialize
1010
from twilio.base import values
11+
from twilio.base.instance_context import InstanceContext
1112
from twilio.base.instance_resource import InstanceResource
1213
from twilio.base.list_resource import ListResource
1314
from twilio.base.page import Page
@@ -134,6 +135,36 @@ def get_page(self, target_url):
134135

135136
return BrandVettingPage(self._version, response, self._solution)
136137

138+
def get(self, brand_vetting_sid):
139+
"""
140+
Constructs a BrandVettingContext
141+
142+
:param brand_vetting_sid: SID for third-party vetting record
143+
144+
:returns: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingContext
145+
:rtype: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingContext
146+
"""
147+
return BrandVettingContext(
148+
self._version,
149+
brand_sid=self._solution['brand_sid'],
150+
brand_vetting_sid=brand_vetting_sid,
151+
)
152+
153+
def __call__(self, brand_vetting_sid):
154+
"""
155+
Constructs a BrandVettingContext
156+
157+
:param brand_vetting_sid: SID for third-party vetting record
158+
159+
:returns: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingContext
160+
:rtype: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingContext
161+
"""
162+
return BrandVettingContext(
163+
self._version,
164+
brand_sid=self._solution['brand_sid'],
165+
brand_vetting_sid=brand_vetting_sid,
166+
)
167+
137168
def __repr__(self):
138169
"""
139170
Provide a friendly representation
@@ -185,14 +216,62 @@ def __repr__(self):
185216
return '<Twilio.Messaging.V1.BrandVettingPage>'
186217

187218

219+
class BrandVettingContext(InstanceContext):
220+
""" PLEASE NOTE that this class contains beta products that are subject to
221+
change. Use them with caution. """
222+
223+
def __init__(self, version, brand_sid, brand_vetting_sid):
224+
"""
225+
Initialize the BrandVettingContext
226+
227+
:param Version version: Version that contains the resource
228+
:param brand_sid: A2P BrandRegistration Sid
229+
:param brand_vetting_sid: SID for third-party vetting record
230+
231+
:returns: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingContext
232+
:rtype: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingContext
233+
"""
234+
super(BrandVettingContext, self).__init__(version)
235+
236+
# Path Solution
237+
self._solution = {'brand_sid': brand_sid, 'brand_vetting_sid': brand_vetting_sid, }
238+
self._uri = '/a2p/BrandRegistrations/{brand_sid}/Vettings/{brand_vetting_sid}'.format(**self._solution)
239+
240+
def fetch(self):
241+
"""
242+
Fetch the BrandVettingInstance
243+
244+
:returns: The fetched BrandVettingInstance
245+
:rtype: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingInstance
246+
"""
247+
payload = self._version.fetch(method='GET', uri=self._uri, )
248+
249+
return BrandVettingInstance(
250+
self._version,
251+
payload,
252+
brand_sid=self._solution['brand_sid'],
253+
brand_vetting_sid=self._solution['brand_vetting_sid'],
254+
)
255+
256+
def __repr__(self):
257+
"""
258+
Provide a friendly representation
259+
260+
:returns: Machine friendly representation
261+
:rtype: str
262+
"""
263+
context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
264+
return '<Twilio.Messaging.V1.BrandVettingContext {}>'.format(context)
265+
266+
188267
class BrandVettingInstance(InstanceResource):
189268
""" PLEASE NOTE that this class contains beta products that are subject to
190269
change. Use them with caution. """
191270

192271
class VettingProvider(object):
193272
CAMPAIGN_VERIFY = "campaign-verify"
194273

195-
def __init__(self, version, payload, brand_sid):
274+
def __init__(self, version, payload, brand_sid, brand_vetting_sid=None):
196275
"""
197276
Initialize the BrandVettingInstance
198277
@@ -217,7 +296,27 @@ def __init__(self, version, payload, brand_sid):
217296

218297
# Context
219298
self._context = None
220-
self._solution = {'brand_sid': brand_sid, }
299+
self._solution = {
300+
'brand_sid': brand_sid,
301+
'brand_vetting_sid': brand_vetting_sid or self._properties['brand_vetting_sid'],
302+
}
303+
304+
@property
305+
def _proxy(self):
306+
"""
307+
Generate an instance context for the instance, the context is capable of
308+
performing various actions. All instance actions are proxied to the context
309+
310+
:returns: BrandVettingContext for this BrandVettingInstance
311+
:rtype: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingContext
312+
"""
313+
if self._context is None:
314+
self._context = BrandVettingContext(
315+
self._version,
316+
brand_sid=self._solution['brand_sid'],
317+
brand_vetting_sid=self._solution['brand_vetting_sid'],
318+
)
319+
return self._context
221320

222321
@property
223322
def account_sid(self):
@@ -299,11 +398,21 @@ def url(self):
299398
"""
300399
return self._properties['url']
301400

401+
def fetch(self):
402+
"""
403+
Fetch the BrandVettingInstance
404+
405+
:returns: The fetched BrandVettingInstance
406+
:rtype: twilio.rest.messaging.v1.brand_registration.brand_vetting.BrandVettingInstance
407+
"""
408+
return self._proxy.fetch()
409+
302410
def __repr__(self):
303411
"""
304412
Provide a friendly representation
305413
306414
:returns: Machine friendly representation
307415
:rtype: str
308416
"""
309-
return '<Twilio.Messaging.V1.BrandVettingInstance>'
417+
context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
418+
return '<Twilio.Messaging.V1.BrandVettingInstance {}>'.format(context)

twilio/rest/verify/v2/service/entity/factor.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def update(self, auth_payload=values.unset, friendly_name=values.unset,
253253
config_notification_token=values.unset,
254254
config_sdk_version=values.unset, config_time_step=values.unset,
255255
config_skew=values.unset, config_code_length=values.unset,
256-
config_alg=values.unset):
256+
config_alg=values.unset, config_notification_platform=values.unset):
257257
"""
258258
Update the FactorInstance
259259
@@ -265,6 +265,7 @@ def update(self, auth_payload=values.unset, friendly_name=values.unset,
265265
:param unicode config_skew: The number of past and future time-steps valid at a given time
266266
:param unicode config_code_length: Number of digits for generated TOTP codes
267267
:param FactorInstance.TotpAlgorithms config_alg: The algorithm used to derive the TOTP codes
268+
:param unicode config_notification_platform: The transport technology used to generate the Notification Token
268269
269270
:returns: The updated FactorInstance
270271
:rtype: twilio.rest.verify.v2.service.entity.factor.FactorInstance
@@ -278,6 +279,7 @@ def update(self, auth_payload=values.unset, friendly_name=values.unset,
278279
'Config.Skew': config_skew,
279280
'Config.CodeLength': config_code_length,
280281
'Config.Alg': config_alg,
282+
'Config.NotificationPlatform': config_notification_platform,
281283
})
282284

283285
payload = self._version.update(method='POST', uri=self._uri, data=data, )
@@ -316,6 +318,7 @@ class FactorTypes(object):
316318
class NotificationPlatforms(object):
317319
APN = "apn"
318320
FCM = "fcm"
321+
NONE = "none"
319322

320323
class TotpAlgorithms(object):
321324
SHA1 = "sha1"
@@ -491,7 +494,7 @@ def update(self, auth_payload=values.unset, friendly_name=values.unset,
491494
config_notification_token=values.unset,
492495
config_sdk_version=values.unset, config_time_step=values.unset,
493496
config_skew=values.unset, config_code_length=values.unset,
494-
config_alg=values.unset):
497+
config_alg=values.unset, config_notification_platform=values.unset):
495498
"""
496499
Update the FactorInstance
497500
@@ -503,6 +506,7 @@ def update(self, auth_payload=values.unset, friendly_name=values.unset,
503506
:param unicode config_skew: The number of past and future time-steps valid at a given time
504507
:param unicode config_code_length: Number of digits for generated TOTP codes
505508
:param FactorInstance.TotpAlgorithms config_alg: The algorithm used to derive the TOTP codes
509+
:param unicode config_notification_platform: The transport technology used to generate the Notification Token
506510
507511
:returns: The updated FactorInstance
508512
:rtype: twilio.rest.verify.v2.service.entity.factor.FactorInstance
@@ -516,6 +520,7 @@ def update(self, auth_payload=values.unset, friendly_name=values.unset,
516520
config_skew=config_skew,
517521
config_code_length=config_code_length,
518522
config_alg=config_alg,
523+
config_notification_platform=config_notification_platform,
519524
)
520525

521526
def __repr__(self):

twilio/rest/verify/v2/service/entity/new_factor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ class FactorTypes(object):
158158
class NotificationPlatforms(object):
159159
APN = "apn"
160160
FCM = "fcm"
161+
NONE = "none"
161162

162163
class TotpAlgorithms(object):
163164
SHA1 = "sha1"

0 commit comments

Comments
 (0)
0