File: fax_response.py

package info (click to toggle)
python-twilio 6.51.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,260 kB
  • sloc: python: 128,982; makefile: 51
file content (52 lines) | stat: -rw-r--r-- 1,376 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# coding=utf-8
r"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

import json
from twilio.twiml import (
    TwiML,
    format_language,
)


class FaxResponse(TwiML):
    """ <Response> TwiML for Faxes """

    def __init__(self, **kwargs):
        super(FaxResponse, self).__init__(**kwargs)
        self.name = 'Response'

    def receive(self, action=None, method=None, media_type=None, page_size=None,
                store_media=None, **kwargs):
        """
        Create a <Receive> element

        :param action: Receive action URL
        :param method: Receive action URL method
        :param media_type: The media type used to store media in the fax media store
        :param page_size: What size to interpret received pages as
        :param store_media: Whether or not to store received media in the fax media store
        :param kwargs: additional attributes

        :returns: <Receive> element
        """
        return self.nest(Receive(
            action=action,
            method=method,
            media_type=media_type,
            page_size=page_size,
            store_media=store_media,
            **kwargs
        ))


class Receive(TwiML):
    """ <Receive> TwiML Verb """

    def __init__(self, **kwargs):
        super(Receive, self).__init__(**kwargs)
        self.name = 'Receive'