8000 [Librarian] Regenerated @ 5b6dad1d54a22b35c87acbe980a4c67256b62b89 · henfee/twilio-python@5b960da · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b960da

Browse files
committed
[Librarian] Regenerated @ 5b6dad1d54a22b35c87acbe980a4c67256b62b89
1 parent 3b4d535 commit 5b960da

File tree

12 files changed

+187
-24
lines changed

12 files changed

+187
-24
lines changed

CHANGES.md

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

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

6+
[2018-10-15] Version 6.19.1
7+
----------------------------
8+
**Api**
9+
- Add <Pay> Verb Transactions category to usage records
10+
11+
**Twiml**
12+
- Add support for `Pay` verb
13+
14+
615
[2018-10-15] Version 6.19.0
716
----------------------------
817
**Api**

twilio/rest/api/v2010/account/usage/record/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line number 8000 Diff line numberDiff line change
@@ -338,6 +338,7 @@ class Category(object):
338338
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
339339
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
340340
CALLS_OUTBOUND = "calls-outbound"
341+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
341342
CALLS_RECORDINGS = "calls-recordings"
342343
CALLS_SIP = "calls-sip"
343344
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/record/all_time.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class Category(object):
224224
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
225225
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
226226
CALLS_OUTBOUND = "calls-outbound"
227+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
227228
CALLS_RECORDINGS = "calls-recordings"
228229
CALLS_SIP = "calls-sip"
229230
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/record/daily.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class Category(object):
224224
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
225225
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
226226
CALLS_OUTBOUND = "calls-outbound"
227+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
227228
CALLS_RECORDINGS = "calls-recordings"
228229
CALLS_SIP = "calls-sip"
229230
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/record/last_month.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class Category(object):
224224
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
A3E2
225225
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
226226
CALLS_OUTBOUND = "calls-outbound"
227+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
227228
CALLS_RECORDINGS = "calls-recordings"
228229
CALLS_SIP = "calls-sip"
229230
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/record/monthly.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class Category(object):
224224
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
225225
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
226226
CALLS_OUTBOUND = "calls-outbound"
227+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
227228
CALLS_RECORDINGS = "calls-recordings"
228229
CALLS_SIP = "calls-sip"
229230
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/record/this_month.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class Category(object):
224224
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
225225
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
226226
CALLS_OUTBOUND = "calls-outbound"
227+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
227228
CALLS_RECORDINGS = "calls-recordings"
228229
CALLS_SIP = "calls-sip"
229230
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/record/today.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class Category(object):
224224
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
225225
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
226226
CALLS_OUTBOUND = "calls-outbound"
227+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
227228
CALLS_RECORDINGS = "calls-recordings"
228229
CALLS_SIP = "calls-sip"
229230
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/record/yearly.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class Category(object):
224224
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
225225
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
226226
CALLS_OUTBOUND = "calls-outbound"
227+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
227228
CALLS_RECORDINGS = "calls-recordings"
228229
CALLS_SIP = "calls-sip"
229230
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/record/yesterday.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class Category(object):
224224
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
225225
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
226226
CALLS_OUTBOUND = "calls-outbound"
227+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
227228
CALLS_RECORDINGS = "calls-recordings"
228229
CALLS_SIP = "calls-sip"
229230
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/rest/api/v2010/account/usage/trigger.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ class UsageCategory(object):
365365
CALLS_INBOUND_MOBILE = "calls-inbound-mobile"
366366
CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree"
367367
CALLS_OUTBOUND = "calls-outbound"
368+
CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions"
368369
CALLS_RECORDINGS = "calls-recordings"
369370
CALLS_SIP = "calls-sip"
370371
CALLS_SIP_INBOUND = "calls-sip-inbound"

twilio/twiml/voice_response.py

Lines changed: 168 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,138 @@ def sms(self, message, to=None, from_=None, action=None, method=None,
325325
**kwargs
326326
))
327327

328+
def pay(self, input=None, action=None, status_callback=None,
329+
status_callback_method=None, timeout=None, max_attempts=None,
330+
security_code=None, postal_code=None, payment_connector=None,
331+
token_type=None, charge_amount=None, currency=None, credential_sid=None,
332+
description=None, valid_card_types=None, language=None, **kwargs):
333+
"""
334+
Create a <Pay> element
328335
329-
class Sms(TwiML):
330-
""" <Sms> TwiML Noun """
336+
:param input: Input type Twilio should accept
337+
:param action: Action URL
338+
:param status_callback: Status callback URL
339+
:param status_callback_method: Status callback method
340+
:param timeout: Time to wait to gather input
341+
:param max_attempts: Maximum number of allowed retries when gathering input
342+
:param security_code: Prompt for security code
343+
:param postal_code: Prompt for postal code and it should be true/false or default postal code
344+
:param payment_connector: Unique name for payment connector
345+
:param token_type: Type of token
346+
:param charge_amount: Amount to process. If value is greater than 0 then make the payment else create a payment token
347+
:param currency: Currency of the amount attribute
348+
:param credential_sid: SID for API keys to communicate with payment provider
349+
:param description: Details regarding the payment
350+
:param valid_card_types: Comma separated accepted card types
351+
:param language: Language to use
352+
:param kwargs: additional attributes
353+
354+
:returns: <Pay> element
355+
"""
356+
return self.nest(Pay(
357+
input=input,
358+
action=action,
359+
status_callback=status_callback,
360+
status_callback_method=status_callback_method,
361+
timeout=timeout,
362+
max_attempts=max_attempts,
363+
security_code=security_code,
364+
postal_code=postal_code,
365+
payment_connector=payment_connector,
366+
token_type=token_type,
367+
charge_amount=charge_amount,
368+
currency=currency,
369+
credential_sid=credential_sid,
370+
description=description,
371+
valid_card_types=valid_card_types,
372+
language=language,
373+
**kwargs
374+
))
375+
376+
def prompt(self, for_=None, error_type=None, card_type=None, attempt=None,
377+
**kwargs):
378+
"""
379+
Create a <Prompt> element
380+
381+
:param for_: Name of the credit card data element
382+
:param error_type: Type of error
383+
:param card_type: Type of the credit card
384+
:param attempt: Current attempt count
385+
:param kwargs: additional attributes
386+
387+
:returns: <Prompt> element
388+
"""
389+
return self.nest(Prompt(
390+
for_=for_,
391+
error_type=error_type,
392+
card_type=card_type,
393+
attempt=attempt,
394+
**kwargs
395+
))
331396

332-
def __init__(self, message, **kwargs):
333-
super(Sms, self).__init__(**kwargs)
334-
self.name = 'Sms'
335-
self.value = message
397+
398+
class Prompt(TwiML):
399+
""" <Prompt> Twiml Verb """
400+
401+
def __init__(self, **kwargs):
402+
super(Prompt, self).__init__(**kwargs)
403+
self.name = 'Prompt'
404+
405+
def say(self, message=None, voice=None, loop=None, language=None, **kwargs):
406+
"""
407+
Create a <Say> element
408+
409+
:param message: Message to say
410+
:param voice: Voice to use
411+
:param loop: Times to loop message
412+
:param language: Message langauge
413+
:param kwargs: additional attributes
414+
415+
:returns: <Say> element
416+
"""
417+
return self.nest(Say(message=message, voice=voice, loop=loop, language=language, **kwargs))
418+
419+
def play(self, url=None, loop=None, digits=None, **kwargs):
420+
"""
421+
Create a <Play> element
422+
423+
:param url: Media URL
424+
:param loop: Times to loop media
425+
:param digits: Play DTMF tones for digits
426+
:param kwargs: additional attributes
427+
428+
:returns: <Play> element
429+
"""
430+
return self.nest(Play(url=url, loop=loop, digits=digits, **kwargs))
431+
432+
def pause(self, length=None, **kwargs):
433+
"""
434+
Create a <Pause> element
435+
436+
:param length: Length in seconds to pause
437+
:param kwargs: additional attributes
438+
439+
:returns: <Pause> element
440+
"""
441+
return self.nest(Pause(length=length, **kwargs))
442+
443+
444+
class Pause(TwiML):
445+
""" <Pause> TwiML Verb """
446+
447+
def __init__(self, **kwargs):
448+
super(Pause, self).__init__(**kwargs)
449+
self.name = 'Pause'
450+
451+
452+
class Play(TwiML):
453+
""" <Play> TwiML Verb """
454+
455+
def __init__(self, url=None, **kwargs):
456+
super(Play, self).__init__(**kwargs)
457+
self.name = 'Play'
458+
if url:
459+
self.value = url
336460

337461

338462
class Say(TwiML):
@@ -556,6 +680,44 @@ def __init__(self, **kwargs):
556680
self.name = 'break'
557681

558682

683+
class Pay(TwiML):
684+
""" <Pay> Twiml Verb """
685+
686+
def __init__(self, **kwargs):
687+
super(Pay, self).__init__(**kwargs)
688+
self.name = 'Pay'
689+
690+
def prompt(self, for_=None, error_type=None, card_type=None, attempt=None,
691+
**kwargs):
692+
"""
693+
Create a <Prompt> element
694+
695+
:param for_: Name of the credit card data element
696+
:param error_type: Type of error
697+
:param card_type: Type of the credit card
698+
:param attempt: Current attempt count
699+
:param kwargs: additional attributes
700+
701+
:returns: <Prompt> element
702+
"""
703+
return self.nest(Prompt(
704+
for_=for_,
705+
error_type=error_type,
706+
card_type=card_type,
707+
attempt=attempt,
708+
**kwargs
709+
))
710+
711+
712+
class Sms(TwiML):
713+
""" <Sms> TwiML Noun """
714+
715+
def __init__(self, message, **kwargs):
716+
super(Sms, self).__init__(**kwargs)
717+
self.name = 'Sms'
718+
self.value = message
719+
720+
559721
class Reject(TwiML):
560722
""" <Reject> TwiML Verb """
561723

@@ -590,24 +752,6 @@ def __init__(self, name, **kwargs):
590752
self.value = name
591753

592754

593-
class Play(TwiML):
594-
""" <Play> TwiML Verb """
595-
596-
def __init__(self, url=None, **kwargs):
597-
super(Play, self).__init__(**kwargs)
598-
self.name = 'Play'
599-
if url:
600-
self.value = url
601-
602-
603-
class Pause(TwiML):
604-
""" <Pause> TwiML Verb """
605-
606-
def __init__(self, **kwargs):
607-
super(Pause, self).__init__(**kwargs)
608-
self.name = 'Pause'
609-
610-
611755
class Leave(TwiML):
612756
""" <Leave> TwiML Verb """
613757

0 commit comments

Comments
 (0)
0