Example #1
0
class Usage(JsonObject):
    """An Urjanet "Usage" object.

    From Urjanet's documentation:
      | The Usage table stores commodity-specific consumption data.
      | Here, you will find information such as consumption amounts,
      | read types, present and previous meter readings, and units
      | of measure.
    """

    # The primary key of the Usage object in the Urjanet database
    PK = IntegerProperty(required=True)

    # A string description of the usage measurement
    UsageActualName = StringProperty()

    # The measured amount of usage
    UsageAmount = DecimalProperty()

    # The rate component, e.g. "on peak", "off peak", etc.
    RateComponent = StringProperty()

    # The measurement type, "general_consumption", "demand", or "reactive_consumption"
    MeasurementType = StringProperty()

    # Unit of measure, typically kW or kWh
    EnergyUnit = StringProperty()

    # The start date for the usage measurement
    IntervalStart = DateProperty()

    # The end date for the usage measurement
    IntervalEnd = DateProperty()
Example #2
0
class PrimerOutput(JsonObject):
    direction = StringProperty(required=True)
    normal_order_sequence = StringProperty(required=True)
    normal_order_start = IntegerProperty(required=True)
    three_end_temperature = FloatProperty(required=True)
    gc_content = FloatProperty(required=True)
    parameters_in_range = BooleanProperty(required=True)
Example #3
0
class Status(JsonObject):
    """ Status model for issue fields """
    description = StringProperty()
    iconUrl = StringProperty()
    name = StringProperty()
    id_ = StringProperty(name='id')
    statusCategory = ObjectProperty(StatusCategory)
Example #4
0
class Component(JsonObject):
    """ Component model for issue fields """
    id_ = StringProperty(name='id')
    name = StringProperty()
    description = StringProperty()
    def __str__(self):
        return self.name
Example #5
0
class MeterSummary(JsonObject):
    address = StringProperty()
    service_id = StringProperty()
    service_uuid = (
        StringProperty()
    )  # This is the usage-point identifier in SMD green button.
    service_type = StringProperty()
Example #6
0
class Project(JsonObject):
    key = StringProperty()
    id_ = IntegerProperty(name='id')
    name = StringProperty()
    public = BooleanProperty()
    type_ = StringProperty(name='type')
    description = StringProperty(default="")
Example #7
0
class Customer(JsonObject):
    ownId = StringProperty(required=True)
    fullname = StringProperty(required=True)
    email = StringProperty(required=True)
    birthDate = StringProperty(required=True)
    taxDocument = ObjectProperty(TaxDocument, required=True)
    phone = ObjectProperty(Phone, required=True)
    shippingAddress = ObjectProperty(ShippingAddress, required=True)
Example #8
0
class User(JsonObject):
    name = StringProperty()
    emailAddress = StringProperty()
    id_ = IntegerProperty(name='id')
    displayName = StringProperty()
    active = BooleanProperty()
    slug = StringProperty()
    type_ = StringProperty(name="type")
Example #9
0
class Sprint(JsonObject):
    """ Spring model """
    id_ = IntegerProperty(name='id')
    state = StringProperty(name='state')
    name = StringProperty(name='name')
    start_date = DateTimeProperty(name='startDate')
    end_date = DateTimeProperty(name='endDate')
    complete_date = DateTimeProperty(name='completeDate')
    origin_board_id = IntegerProperty(name='originBoardId')
Example #10
0
class Version(JsonObject):
    """ Version model """
    id_ = IntegerProperty(name='id')
    project_id = IntegerProperty(name='projectId')
    name = StringProperty()
    description = StringProperty()
    archived = BooleanProperty()
    released = BooleanProperty()
    release_date = DateTimeProperty(name='releaseDate')
Example #11
0
class ReportsForm(JsonObject):
    time = DateTimeProperty()
    completion_time = DateTimeProperty()
    start_time = DateTimeProperty()
    duration = IntegerProperty()
    submission_time = DateTimeProperty()
    xmlns = StringProperty()
    app_id = StringProperty()
    user_id = StringProperty()
    username = StringProperty()
Example #12
0
class Version(JsonObject):
    """ Version model """
    id_ = IntegerProperty(name='id')
    projectId = IntegerProperty()
    name = StringProperty()
    description = StringProperty()
    archived = BooleanProperty()
    released = BooleanProperty()
    releaseDate = CustomDateTimeProperty(
        datetime_format="%Y-%m-%d %H:%M:%S.%z")
    startDate = CustomDateTimeProperty(datetime_format="%Y-%m-%d %H:%M:%S.%z")
Example #13
0
class Command(JsonObject):
    operation = StringProperty(
        choices=['create', 'delete', 'select', 'list', 'current'],
        required=True)
    subject = StringProperty(choices=['file', 'sheet', 'topic'], required=True)
    name = StringProperty()
    virtual_id = IntegerProperty()
    user_id = IntegerProperty()
    chat_id = IntegerProperty()

    def __eq__(self, other):
        return self.operation == other.operation and self.subject == other.subject and self.name == other.name and self.virtual_id == other.virtual_id and self.user_id == other.user_id and self.chat_id == other.chat_id
Example #14
0
class ListOrdersFilters(JsonObject):
    """
    status_choices = ['WAITING', 'NOT_PAID', 'PAID', 'REVERTED']
    paymentMethod = ['DEBIT_CARD', 'BOLETO', 'ONLINE_BANK_FINANCING',
                     'ONLINE_BANK_DEBIT', 'WALLET']
    """
    createdAt = DateProperty(exclude_if_none=True)
    paymentMethod = StringProperty(exclude_if_none=True)
    value = StringProperty(exclude_if_none=True)
    status = StringProperty(exclude_if_none=True)
    limit = IntegerProperty(exclude_if_none=True)
    offset = IntegerProperty(exclude_if_none=True)
Example #15
0
class QCLMSequences(JsonObject):
    gene_of_interest = StringProperty(required=True)
    five_end_flanking_sequence = StringProperty(default="")
    three_end_flanking_sequence = StringProperty(default="")

    def get_full_sequence_with_offset(self) -> Tuple[str, int]:
        full_sequence = \
            self.five_end_flanking_sequence + \
            self.gene_of_interest + \
            self.three_end_flanking_sequence
        offset = len(self.five_end_flanking_sequence)
        return full_sequence, offset
Example #16
0
class StatusCategory(JsonObject):
    """ StatusCategory model for Status """
    id_ = IntegerProperty(name='id')
    key = StringProperty()
    colorName = StringProperty()
    name = StringProperty()

    def color(self):
        """ Convert to termcolor """
        if self.colorName == 'blue-gray':
            return 'blue'
        return self.colorName
Example #17
0
class TaxJarLineItem(JsonObject):
    # NB: SmartCalcs can return either string or integer
    # `id` is a valid property, but isn't enforced here
    # id = StringProperty()

    product_identifier = StringProperty()
    description = StringProperty()

    quantity = IntegerProperty()

    unit_price = TaxJarFloatProperty()
    discount = TaxJarFloatProperty()
    sales_tax = TaxJarFloatProperty()
Example #18
0
class Epic(JsonObject):
    """ Epic model """
    id_ = IntegerProperty(name='id')
    done = BooleanProperty()
    key = IntegerProperty()
    name = StringProperty()
    color = ObjectProperty(EpicColor)
class AcceptedMessage(JsonObject):

    message_id = IntegerProperty(required=True)
    from_field = ObjectProperty(User, name='from', required=True)
    date = IntegerProperty()
    chat = ObjectProperty(Chat, required=True)
    text = StringProperty(required=True)
Example #20
0
class Fields(JsonObject):
    """ Fields model for issue"""
    status = ObjectProperty(Status)
    components = ListProperty(Component, default=None)
    labels = ListProperty(StringProperty, default=None)
    summary = StringProperty(default='')
    assignee = ObjectProperty(User)
    closed_sprints = ListProperty(Sprint, default=None, name='closedSprints')
    reporter = ObjectProperty(User)
    issue_type = ObjectProperty(IssueType)
    parent_ = DefaultProperty(default=None, name='parent')
    subtasks_ = DefaultProperty(default=None, name='subtasks')

    @property
    def parent(self):
        """ Getter for parent issue """
        if self.parent_:
            return Issue(self.parent_)
        return None

    @property
    def subtasks(self):
        """ Getter for subtasks """
        if self.subtasks_:
            return list(map(Issue, self.subtasks_))
        return None
Example #21
0
class Charge(JsonObject):
    """An Urjanet "Charge" object.

    From the Urjanet documentation:
      | The Charge table includes information related to the
      | line-item charges on your utility bill. Here, you can
      | find details such as charges names, rates, and currencies.
      | If a charge is associated with more than one meter, Urjanet
      | will prorate the charge based on the usage amount.

    Note especially the description of proration, which can
    manifest in some somewhat difficult to interpret data.
    """

    # The primary key of the Charge object in the Urjanet database
    PK = IntegerProperty(required=True)

    # The line item name
    ChargeActualName = StringProperty()

    # The charge amount in dollars
    ChargeAmount = DecimalProperty()

    # The usage associated with this charge, if any
    ChargeUnitsUsed = DecimalProperty()

    # The units on the usage associated with this charge
    UsageUnit = StringProperty()

    # The rate associated with this charge (e.g. price per unit of usage)
    ChargeRatePerUnit = DecimalProperty()

    # The name of any third party provider (e.g. a CCA entity)
    # This is useful for identifying CCA charges
    ThirdPartyProvider = StringProperty()

    # TODO: Explain this flag in more detail. It may be a somewhat
    # misleading field. For now, avoid using it.
    IsAdjustmentCharge = BooleanProperty()

    # The start date for the period the charge applies to
    IntervalStart = DateProperty()

    # The end date for the period the charge applies to
    IntervalEnd = DateProperty()

    ChargeId = StringProperty()
Example #22
0
class ProtectedSaleOrder(JsonObject):
    ownId = StringProperty(required=True)
    amount = ObjectProperty(Amount, exclude_if_none=True)
    items = ListProperty(Item, required=True)
    customer = ObjectProperty(Customer, required=True)
    checkoutPreferences = ObjectProperty(CheckoutPreferences,
                                         exclude_if_none=True,
                                         default=None)