How to use the messagebird.base_list.BaseList function in messagebird

To help you get started, we’ve selected a few messagebird examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github messagebird / python-rest-api / messagebird / call_flow.py View on Github external
from messagebird.base import Base
from messagebird.base_list import BaseList


class CallFlowList(BaseList):

    def __init__(self):
        self._data = None
        self._pagination = None

        super(CallFlowList, self).__init__(CallFlow)

    @property
    def data(self):
        return self._data

    @property
    def pagination(self):
        return self._pagination

    @pagination.setter
github messagebird / python-rest-api / messagebird / voice_transcription.py View on Github external
from messagebird.base_list import BaseList
from messagebird.voice_transcription_data import VoiceTranscriptionData


class VoiceTranscriptionsList(BaseList):
    def __init__(self):
        super(VoiceTranscriptionsList, self).__init__(VoiceTranscriptionData)
        self.perPage = None
        self.currentPage = None
        self.pageCount = None
        self._pagination = None

    @property
    def data(self):
        return self.items

    @property
    def pagination(self):
        return {
            "totalCount": self.totalCount,
            "pageCount": self.pageCount,
github messagebird / python-rest-api / messagebird / voice_transcription.py View on Github external
if isinstance(value, dict):
            self.totalCount = value['totalCount']
            self.pageCount = value['pageCount']
            self.currentPage = value['currentPage']
            self.perPage = value['perPage']
            self.limit = self.perPage * self.currentPage
            self.offset = self.perPage * (self.currentPage - 1)

    @data.setter
    def data(self, value):
        if isinstance(value, list):
            self.count = len(value)
            self.items = value


class VoiceTranscriptionsView(BaseList):
    def __init__(self):
        super(VoiceTranscriptionsView, self).__init__(VoiceTranscriptionData)

    @property
    def data(self):
        return self.items

    @data.setter
    def data(self, value):
        if isinstance(value, list):
            self.items = value
github messagebird / python-rest-api / messagebird / call_flow.py View on Github external
    @pagination.setter
    def pagination(self, value):
        self._pagination = value

    @data.setter
    def data(self, value):
        """Create typed objects from the dicts."""
        items = []
        for item in value:
            items.append(self.itemType().load(item))

        self._data = items


class CallFlowNumberList(BaseList):
    def __init__(self):
        self._data = None
        self._pagination = None

        super(CallFlowNumberList, self).__init__(CallFlowNumber)

    @property
    def data(self):
        return self._data

    @property
    def pagination(self):
        return self._pagination

    @pagination.setter
    def pagination(self, value):
github messagebird / python-rest-api / messagebird / call_list.py View on Github external
from messagebird.base_list import BaseList
from messagebird.call_data import CallData


class CallList(BaseList):
    def __init__(self):
        # We're expecting items of type CallData
        super(CallList, self).__init__(CallData)
        self.perPage = None
        self.currentPage = None
        self.pageCount = None
        self._pagination = None

    @property
    def data(self):
        return self.items

    @property
    def pagination(self):
        return {
            "totalCount": self.totalCount,
github messagebird / python-rest-api / messagebird / message.py View on Github external
from messagebird.base import Base
from messagebird.base_list import BaseList
from messagebird.recipient import Recipient


class MessageList(BaseList):
    def __init__(self):
        # We're expecting items of type Message
        super(MessageList, self).__init__(Message)


class Message(Base):
    def __init__(self):
        self.id = None
        self.href = None
        self.direction = None
        self.type = None
        self.originator = None
        self.body = None
        self.reference = None
        self.validity = None
        self.gateway = None