7
7
"""
8
8
9
9
import json
10
+ from twilio .base .obsolete import deprecated_method
10
11
from twilio .twiml import (
11
12
TwiML ,
12
13
format_language ,
@@ -618,7 +619,7 @@ def __init__(self, message=None, **kwargs):
618
619
if message :
619
620
self .value = message
620
621
621
- def ssml_break (self , strength = None , time = None , ** kwargs ):
622
+ def break_ (self , strength = None , time = None , ** kwargs ):
622
623
"""
623
624
Create a <Break> element
624
625
@@ -630,7 +631,20 @@ def ssml_break(self, strength=None, time=None, **kwargs):
630
631
"""
631
632
return self .nest (SsmlBreak (strength = strength , time = time , ** kwargs ))
632
633
633
- def ssml_emphasis (self , words , level = None , ** kwargs ):
634
+ @deprecated_method ('break_' )
635
+ def ssml_break (self , strength = None , time = None , ** kwargs ):
636
+ """
637
+ Create a <Break> element
638
+
639
+ :param strength: Set a pause based on strength
640
+ :param time: Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms
641
+ :param kwargs: additional attributes
642
+
643
+ :returns: <Break> element
644
+ """
645
+ return self .break_ (strength = strength , time = time , ** kwargs )
646
+
647
+ def emphasis (self , words , level = None , ** kwargs ):
634
648
"""
635
649
Create a <Emphasis> element
636
650
@@ -642,7 +656,20 @@ def ssml_emphasis(self, words, level=None, **kwargs):
642
656
"""
643
657
return self .nest (SsmlEmphasis (words , level = level , ** kwargs ))
644
658
645
- def ssml_lang (self , words , xml_lang = None , ** kwargs ):
659
+ @deprecated_method ('emphasis' )
660
+ def ssml_emphasis (self , words , level = None , ** kwargs ):
661
+ """
662
+ Create a <Emphasis> element
663
+
664
+ :param words: Words to emphasize
665
+ :param level: Specify the degree of emphasis
666
+ :param kwargs: additional attributes
667
+
668
+ :returns: <Emphasis> element
669
+ """
670
+ return self .emphasis (words , level = level , ** kwargs )
671
+
672
+ def lang (self , words , xml_lang = None , ** kwargs ):
646
673
"""
647
674
Create a <Lang> element
648
675
@@ -654,7 +681,20 @@ def ssml_lang(self, words, xml_lang=None, **kwargs):
654
681
"""
655
682
return self .nest (SsmlLang (words , xml_lang = xml_lang , ** kwargs ))
656
683
657
- def ssml_p (self , words , ** kwargs ):
684
+ @deprecated_method ('lang' )
685
+ def ssml_lang (self , words , xml_lang = None , ** kwargs ):
686
+ """
687
+ Create a <Lang> element
688
+
689
+ :param words: Words to speak
690
+ :param xml:lang: Specify the language
691
+ :param kwargs: additional attributes
692
+
693
+ :returns: <Lang> element
694
+ """
695
+ return self .lang (words , xml_lang = xml_lang , ** kwargs )
696
+
697
+ def p (self , words , ** kwargs ):
658
698
"""
659
699
Create a <P> element
660
700
@@ -665,7 +705,19 @@ def ssml_p(self, words, **kwargs):
665
705
"""
666
706
return self .nest (SsmlP (words , ** kwargs ))
667
707
668
- def ssml_phoneme (self , words , alphabet = None , ph = None , ** kwargs ):
708
+ @deprecated_method ('p' )
709
+ def ssml_p (self , words , ** kwargs ):
710
+ """
711
+ Create a <P> element
712
+
713
+ :param words: Words to speak
714
+ :param kwargs: additional attributes
715
+
716
+ :returns: <P> element
717
+ """
718
+ return self .p (words , ** kwargs )
719
+
720
+ def phoneme (self , words , alphabet = None , ph = None , ** kwargs ):
669
721
"""
670
722
Create a <Phoneme> element
671
723
@@ -678,7 +730,21 @@ def ssml_phoneme(self, words, alphabet=None, ph=None, **kwargs):
678
730
"""
679
731
return self .nest (SsmlPhoneme (words , alphabet = alphabet , ph = ph , ** kwargs ))
680
732
681
- def ssml_prosody (self , words , volume = None , rate = None , pitch = None , ** kwargs ):
733
+ @deprecated_method ('phoneme' )
734
+ def ssml_phoneme (self , words , alphabet = None , ph = None , ** kwargs ):
735
+ """
736
+ Create a <Phoneme> element
737
+
738
+ :param words: Words to speak
739
+ :param alphabet: Specify the phonetic alphabet
740
+ :param ph: Specifiy the phonetic symbols for pronunciation
741
+ :param kwargs: additional attributes
742
+
743
+ :returns: <Phoneme> element
744
+ """
745
+ return self .phoneme (words , alphabet = alphabet , ph = ph , ** kwargs )
746
+
747
+ def prosody (self , words , volume = None , rate = None , pitch = None , ** kwargs ):
682
748
"""
683
749
Create a <Prosody> element
684
750
@@ -692,7 +758,22 @@ def ssml_prosody(self, words, volume=None, rate=None, pitch=None, **kwargs):
692
758
"""
693
759
return self .nest (SsmlProsody (words , volume = volume , rate = rate , pitch = pitch , ** kwargs ))
694
760
695
- def ssml_s (self , words , ** kwargs ):
761
+ @deprecated_method ('prosody' )
762
+ def ssml_prosody (self , words , volume = None , rate = None , pitch = None , ** kwargs ):
763
+ """
764
+ Create a <Prosody> element
765
+
766
+ :param words: Words to speak
767
+ :param volume: Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB
768
+ :param rate: Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n%
769
+ :param pitch: Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n%
770
+ :param kwargs: additional attributes
771
+
772
+ :returns: <Prosody> element
773
+ """
774
+ return self .prosody (words , volume = volume , rate = rate , pitch = pitch , ** kwargs )
775
+
776
+ def s (self , words , ** kwargs ):
696
777
"""
697
778
Create a <S> element
698
779
@@ -703,7 +784,19 @@ def ssml_s(self, words, **kwargs):
703
784
"""
704
785
return self .nest (SsmlS (words , ** kwargs ))
705
786
706
- def ssml_say_as (self , words , interpret_as = None , role = None , ** kwargs ):
787
+ @deprecated_method ('s' )
788
+ def ssml_s (self , words , ** kwargs ):
789
+ """
790
+ Create a <S> element
791
+
792
+ :param words: Words to speak
793
+ :param kwargs: additional attributes
794
+
795
+ :returns: <S> element
796
+ """
797
+ return self .s (words , ** kwargs )
798
+
799
+ def say_as (self , words , interpret_as = None , role = None , ** kwargs ):
707
800
"""
708
801
Create a <Say-As> element
709
802
@@ -716,7 +809,21 @@ def ssml_say_as(self, words, interpret_as=None, role=None, **kwargs):
716
809
"""
717
810
return self .nest (SsmlSayAs (words , interpret_as = interpret_as , role = role , ** kwargs ))
718
811
719
- def ssml_sub (self , words , alias = None , ** kwargs ):
812
+ @deprecated_method ('say_as' )
813
+ def ssml_say_as (self , words , interpret_as = None , role = None , ** kwargs ):
814
+ """
815
+ Create a <Say-As> element
816
+
817
+ :param words: Words to be interpreted
818
+ :param interpret-as: Specify the type of words are spoken
819
+ :param role: Specify the format of the date when interpret-as is set to date
820
+ :param kwargs: additional attributes
821
+
822
+ :returns: <Say-As> element
823
+ """
824
+ return self .say_as (words , interpret_as = interpret_as , role = role , ** kwargs )
825
+
826
+ def sub (self , words , alias = None , ** kwargs ):
720
827
"""
721
828
Create a <Sub> element
722
829
<
10000
/td>
@@ -728,7 +835,20 @@ def ssml_sub(self, words, alias=None, **kwargs):
728
835
"""
729
836
return self .nest (SsmlSub (words , alias = alias , ** kwargs ))
730
837
731
- def ssml_w (self , words , role = None , ** kwargs ):
838
+ @deprecated_method ('sub' )
839
+ def ssml_sub (self , words , alias = None , ** kwargs ):
840
+ """
841
+ Create a <Sub> element
842
+
843
+ :param words: Words to be substituted
844
+ :param alias: Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation
845
+ :param kwargs: additional attributes
846
+
847
+ :returns: <Sub> element
848
+ """
849
+ return self .sub (words , alias = alias , ** kwargs )
850
+
851
+ def w (self , words , role = None , ** kwargs ):
732
852
"""
733
853
Create a <W> element
734
854
@@ -740,6 +860,19 @@ def ssml_w(self, words, role=None, **kwargs):
740
860
"""
741
861
return self .nest (SsmlW (words , role = role , ** kwargs ))
742
862
863
+ @deprecated_method ('w' )
864
+ def ssml_w (self , words , role = None , ** kwargs ):
865
+ """
866
+ Create a <W> element
867
+
868
+ :param words: Words to speak
869
+ :param role: Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning
870
+ :param kwargs: additional attributes
871
+
872
+ :returns: <W> element
873
+ """
874
+ return self .w (words , role = role , ** kwargs )
875
+
743
876
744
877
class SsmlW (TwiML ):
745
878
""" Improving Pronunciation by Specifying Parts of Speech in <Say> """
0 commit comments