How to use the zenpy.lib.objects.base_object.BaseObject function in zenpy

To help you get started, we’ve selected a few zenpy 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 facetoe / zenpy / zenpy / lib / objects / ticket.py View on Github external
import dateutil.parser

from zenpy.lib.objects.base_object import BaseObject


class Ticket(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self._via = None
        self.updated_at = None
        self.submitter_id = None
        self.assignee_id = None
        self.brand_id = None
        self.id = None
        self._custom_fields = None
        self.subject = None
        self.sharing_agreement_ids = None
        self.collaborator_ids = None
        self.priority = None
        self._satisfaction_rating = None
        self.type = None
        self.status = None
github facetoe / zenpy / zenpy / lib / objects / source.py View on Github external
from zenpy.lib.objects.base_object import BaseObject


class Source(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self._to = None
        self._from_ = None
        self.rel = None

        for key, value in kwargs.items():
            setattr(self, key, value)

    @property
    def from_(self):
        if self.api and self._from_:
            return self.api.get_from_(self._from_)

    @from_.setter
    def from_(self, from_):
github facetoe / zenpy / zenpy / lib / objects / events / cc_event.py View on Github external
from zenpy.lib.objects.base_object import BaseObject


class CcEvent(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self._via = None
        self.type = None
        self.id = None
        self._recipients = None

        for key, value in kwargs.items():
            setattr(self, key, value)

    @property
    def via(self):
        if self.api and self._via:
            return self.api.get_via(self._via)

    @via.setter
github facetoe / zenpy / zenpy / lib / objects / events / facebook_comment_event.py View on Github external
from zenpy.lib.objects.base_object import BaseObject


class FacebookCommentEvent(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self.body = None
        self._attachments = None
        self.type = None
        self.public = None
        self.graph_object_id = None
        self.author_id = None
        self._data = None
        self.id = None
        self.trusted = None
        self.html_body = None

        for key, value in kwargs.items():
            setattr(self, key, value)
github facetoe / zenpy / zenpy / lib / objects / result.py View on Github external
from zenpy.lib.objects.base_object import BaseObject


class Result(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self.count = None
        self.facets = None
        self.prev_page = None
        self._results = None
        self.next_page = None

        for key, value in kwargs.items():
            setattr(self, key, value)

    @property
    def results(self):
        if self.api and self._results:
            return self.api.get_results(self._results)
github facetoe / zenpy / zenpy / lib / objects / suspended_ticket.py View on Github external
import dateutil.parser

from zenpy.lib.objects.base_object import BaseObject


class SuspendedTicket(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self._via = None
        self._author = None
        self.url = None
        self.recipient = None
        self.created_at = None
        self.updated_at = None
        self.content = None
        self.brand_id = None
        self.ticket_id = None
        self.cause = None
        self.id = None
        self.subject = None

        for key, value in kwargs.items():
github facetoe / zenpy / zenpy / lib / objects / system.py View on Github external
from zenpy.lib.objects.base_object import BaseObject


class System(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self.latitude = None
        self.client = None
        self.ip_address = None
        self.location = None
        self.longitude = None

        for key, value in kwargs.items():
            setattr(self, key, value)
github facetoe / zenpy / zenpy / lib / objects / events / organizationactivityevent.py View on Github external
from zenpy.lib.objects.base_object import BaseObject


class OrganizationActivityEvent(BaseObject):
    def __init__(self, api=None):
        self.api = api
        self.body = None
        self.via = None
        self.recipients = None
        self.type = None
        self.id = None
        self.subject = None
github facetoe / zenpy / zenpy / lib / objects / events / satisfaction_rating_event.py View on Github external
from zenpy.lib.objects.base_object import BaseObject


class SatisfactionRatingEvent(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self.assignee_id = None
        self.body = None
        self.score = None
        self.type = None
        self.id = None

        for key, value in kwargs.items():
            setattr(self, key, value)

    @property
    def assignee(self):
        if self.api and self.assignee_id:
            return self.api.get_user(self.assignee_id)
github facetoe / zenpy / zenpy / lib / objects / events / ticket_event.py View on Github external
from zenpy.lib.objects.base_object import BaseObject


class TicketEvent(BaseObject):
    def __init__(self, api=None, **kwargs):
        self.api = api
        self.via = None
        self._child_events = None
        self.timestamp = None
        self.ticket_id = None
        self.id = None
        self.updater_id = None

        for key, value in kwargs.items():
            setattr(self, key, value)

    @property
    def child_events(self):
        if self.api and self._child_events:
            return self.api.get_child_events(self._child_events)