Example #1
0
    def __init__(self, auth_id=None, auth_token=None):
        """
        The Plivo API client.

        Deals with all the API requests to be made. To configure a proxy,
        set it on the Requests session. To configure a timeout, you can mount a
        custom transport adapter (see
        https://github.com/requests/requests/issues/2011#issuecomment-64440818)
        """

        self.base_uri = PLIVO_API_BASE_URI
        self.session = requests.Session()
        self.session.headers.update({
            'User-Agent': get_user_agent(),
            'Content-Type': 'application/json',
            'Accept': 'application/json',
        })

        self.session.auth = fetch_credentials(auth_id, auth_token)

        self.account = Accounts(self)
        self.subaccounts = Subaccounts(self)
        self.applications = Applications(self)
        self.calls = Calls(self)
        self.live_calls = LiveCalls(self)
        self.conferences = Conferences(self)
        self.endpoints = Endpoints(self)
        self.messages = Messages(self)
        self.numbers = Numbers(self)
        self.pricing = Pricings(self)
        self.recordings = Recordings(self)
Example #2
0
    def __init__(self, auth_id=None, auth_token=None, proxies=None, timeout=5):
        """
        The Plivo API client.

        Deals with all the API requests to be made.
        """

        self.base_uri = PLIVO_API_BASE_URI
        self.session = Session()
        self.session.headers.update({
            'User-Agent': get_user_agent(),
            'Content-Type': 'application/json',
            'Accept': 'application/json',
        })
        self.session.auth = fetch_credentials(auth_id, auth_token)
        self.multipart_session = Session()
        self.multipart_session.headers.update({
            'User-Agent': get_user_agent(),
            'Cache-Control': 'no-cache',
        })
        self.multipart_session.auth = fetch_credentials(auth_id, auth_token)
        self.proxies = proxies
        self.timeout = timeout
        self.account = Accounts(self)
        self.subaccounts = Subaccounts(self)
        self.applications = Applications(self)
        self.calls = Calls(self)
        self.live_calls = LiveCalls(self)
        self.queued_calls = QueuedCalls(self)
        self.conferences = Conferences(self)
        self.endpoints = Endpoints(self)
        self.messages = Messages(self)
        self.lookup = Lookup(self)
        self.numbers = Numbers(self)
        self.powerpacks = Powerpacks(self)
        self.media = Media(self)
        self.pricing = Pricings(self)
        self.recordings = Recordings(self)
        self.addresses = Addresses(self)
        self.identities = Identities(self)
        self.call_feedback = CallFeedback(self)
        self.end_users = EndUsers(self)
        self.compliance_document_types = ComplianceDocumentTypes(self)
        self.compliance_documents = ComplianceDocuments(self)
        self.compliance_requirements = ComplianceRequirements(self)
        self.compliance_applications = ComplianceApplications(self)
        self.voice_retry_count = 0
Example #3
0
    def __init__(self, auth_id=None, auth_token=None, proxies=None, timeout=5):
        """
        The Plivo API client.

        Deals with all the API requests to be made.
        """
        BaseClient.__init__(self, auth_id, auth_token, proxies, timeout)

        self.account = Accounts(self)
        self.subaccounts = Subaccounts(self)
        self.applications = Applications(self)
        self.calls = Calls(self)
        self.live_calls = LiveCalls(self)
        self.conferences = Conferences(self)
        self.endpoints = Endpoints(self)
        self.messages = Messages(self)
        self.numbers = Numbers(self)
        self.pricing = Pricings(self)
        self.recordings = Recordings(self)
        self.addresses = Addresses(self)
        self.identities = Identities(self)
Example #4
0
    def __init__(self, auth_id=None, auth_token=None, proxies=None, timeout=5):
        """
        The Plivo API client.

        Deals with all the API requests to be made.
        """

        self.base_uri = PLIVO_API_BASE_URI
        self.session = Session()
        self.session.headers.update({
            'User-Agent': get_user_agent(),
            'Content-Type': 'application/json',
            'Accept': 'application/json',
        })
        self.session.auth = fetch_credentials(auth_id, auth_token)
        self.multipart_session = Session()
        self.multipart_session.headers.update({
            'User-Agent': get_user_agent(),
            'Cache-Control': 'no-cache',
        })
        self.multipart_session.auth = fetch_credentials(auth_id, auth_token)
        self.proxies = proxies
        self.timeout = timeout
        self.account = Accounts(self)
        self.subaccounts = Subaccounts(self)
        self.applications = Applications(self)
        self.calls = Calls(self)
        self.live_calls = LiveCalls(self)
        self.conferences = Conferences(self)
        self.endpoints = Endpoints(self)
        self.messages = Messages(self)
        self.numbers = Numbers(self)
        self.pricing = Pricings(self)
        self.recordings = Recordings(self)
        self.addresses = Addresses(self)
        self.identities = Identities(self)