Beispiel #1
0
    def process(cls, verb, imports):
        rename_attr(verb, 'interpret-as', 'interpretAs')
        to_enum(verb, 'interpretAs')
        to_bytes(verb, 'interpretAs')

        to_enum(verb, 'role')
        to_bytes(verb, 'role')
Beispiel #2
0
    def clean(cls, generator) -> None:
        """C# library specificities which requires to change the TwiML IR."""
        for verb, event in generator.twimlir:
            rename_attr(verb, 'for', 'for_')

            if verb.is_ssml:
                verb.name = camelize(verb.name)

            cls.verb_processing(verb, generator.specific_imports)
Beispiel #3
0
    def clean(cls, generator) -> None:
        """Python library specificities which requires to change the TwiML IR.
        """
        for verb, event in generator.twimlir:
            if verb.name == 'break':
                verb.name = 'break_'
            rename_attr(verb, 'from', 'from_')
            rename_attr(verb, 'for', 'for_')

            cls.verb_processing(verb, generator.specific_imports)
Beispiel #4
0
    def clean(cls, generator) -> None:
        """Java library specificities which requires to change the TwiML IR."""

        for verb, event in generator.twimlir:
            if verb.is_ssml:
                verb.variable_name = camelize(f'ssml_{verb.name}',
                                              uppercase_first_letter=False)
                verb.method_name = camelize(verb.name,
                                            uppercase_first_letter=False)
                verb.name = camelize('ssml_' + verb.name)
                import_name = f"import com.twilio.twiml.voice.{verb.name};"
                generator.specific_imports.add(import_name)
            if verb.name == 'Sip' and verb.parent.name == 'Refer':
                verb.name = 'ReferSip'

            cls.verb_processing(verb, generator.specific_imports)

            rename_attr(verb, 'for', 'for_')
            rename_attr(verb, 'break', 'break_')
Beispiel #5
0
    def process(cls, verb, imports):
        to_enum(verb, 'for')
        to_bytes(verb, 'for')

        to_list(verb,
                'cardType',
                imports,
                transform=enum_builder(verb, 'cardType'))
        to_bytes(verb, 'cardType')
        rename_attr(verb, 'cardType', 'cardTypes')

        to_list(verb,
                'errorType',
                imports,
                transform=enum_builder(verb, 'errorType'))
        to_bytes(verb, 'errorType')
        rename_attr(verb, 'errorType', 'errorTypes')

        to_list(verb, "attempt", imports)
        to_bytes(verb, 'attempt')
        rename_attr(verb, 'attempt', 'attempts')
Beispiel #6
0
 def process(cls, verb, imports):
     rename_attr(verb, 'interpret-as', 'interpretAs')
Beispiel #7
0
 def process(cls, verb, imports):
     rename_attr(verb, 'queueName', 'name')
Beispiel #8
0
 def process(cls, verb, imports):
     to_list(verb, 'input', imports, transform=enum_builder(verb, 'input'))
     to_bytes(verb, 'inputs')
     rename_attr(verb, 'input', 'inputs')
Beispiel #9
0
 def process(cls, verb, imports):
     to_list(verb, 'statusCallbackEvent', imports, transform=cls.event_name)
     to_bytes(verb, 'statusCallbackEvent')
     rename_attr(verb, 'statusCallbackEvent', 'statusCallbackEvents')