示例#1
0
class JoinedMonitorDescription(schema_utils.Model):
    """Stores joiner id's and their corresponding monitor information.

    Attributes:
        joiner_id: String that is used to join monitors across transformations.
        monitor_names: List of monitor objects corresponding to the joiner_id.
        monitor_type: String describing the type of data contained in the monitor.
        scalar_operation: String specifying how to process scalar monitor data.
        vector_operation: String specifying how to process planar monitor data.
    """
    joiner_id = types.StringType()
    monitor_names = types.ListType(optplan.ReferenceType(optplan.Monitor))
    monitor_type = types.StringType(choices=("scalar", "planar", "volume"))
    scalar_operation = types.StringType(choices=("magnitude_squared",
                                                 "magnitude", "phase", "real",
                                                 "imag"))
    vector_operation = types.StringType(choices=("magnitude", "x", "y", "z"))

    def __init__(self, *args, **kwargs) -> None:
        """Creates a new `JoinedMonitorDescription`.

        This allows `JoinedMonitorDescription` to be created in these additional
        ways:
        1) If `joiner_id` is not specified, the first entry in `monitor_names`
           is used.
        2) `monitor_name` can be specified as a single string, which will be
           converted to a list and put into `monitor_names`.
        """
        if "monitor_name" in kwargs:
            kwargs["monitor_names"] = [kwargs["monitor_name"]]
            del kwargs["monitor_name"]
        super().__init__(*args, **kwargs)
        if not self.joiner_id:
            self.joiner_id = self.monitor_names[0]
示例#2
0
 class MangoResource(_models.Model):
     '''
         Mango resource
     '''
     uuid = _types.UUIDType(default=_uuid.uuid4)
     account = _types.StringType(required=False)
     resource = _types.StringType(required=True)
class AppConfig(grift.BaseConfig):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        with open(self.CERT_FOLDER + "/" + self.SERVER_CERT_FILE, "rb") as fh:
            self.SERVER_CERT = fh.read()
        with open(self.CERT_FOLDER + "/" + self.JWT_PRIVATE_KEY_FILE,
                  "rb") as fh:
            self.JWT_PRIVATE_KEY = fh.read()
        with open(self.CERT_FOLDER + "/" + self.JWT_PUBLIC_KEY_FILE,
                  "rb") as fh:
            self.JWT_PUBLIC_KEY = fh.read()

    SERVICE_NAME = grift.ConfigProperty(property_type=sch_types.StringType(),
                                        exclude_from_varz=True)
    SERVICE_PORT = grift.ConfigProperty(property_type=sch_types.IntType(),
                                        exclude_from_varz=True)
    CERT_FOLDER = grift.ConfigProperty(property_type=sch_types.StringType(),
                                       exclude_from_varz=True)
    SERVER_CERT_FILE = grift.ConfigProperty(
        property_type=sch_types.StringType(), exclude_from_varz=True)
    JWT_PRIVATE_KEY_FILE = grift.ConfigProperty(
        property_type=sch_types.StringType(), exclude_from_varz=True)
    JWT_PUBLIC_KEY_FILE = grift.ConfigProperty(
        property_type=sch_types.StringType(), exclude_from_varz=True)
示例#4
0
class RegisterCustomer(models.Model):
    '''
        Cuallix Register Customer
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    Customer = compound.ModelType(User)
示例#5
0
class Assign(models.Model):
    '''
        Cuallix Assign account
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    UserId = types.StringType()
示例#6
0
文件: base.py 项目: wavycloud/pylexo
class GenericAttachmentsProperty(PyLexObject):
    title = types.StringType(default='')
    subTitle = types.StringType(default='')
    imageUrl = types.StringType(default='')
    attachmentLinkUrl = types.StringType(default='')
    buttons = types.ListType(types.ModelType(GenericAttachmentButtonProperty), default=[])
    """ :type : List[GenericAttachmentButtonProperty] """
示例#7
0
class SuggestionAddressDTO(DTO):
    """DTO подсказки адреса."""

    value = types.StringType()
    fias_id = types.UUIDType()
    lat = types.StringType()
    lon = types.StringType()
    fias_level = types.StringType(choices=AddressTypeEnum.choices(), )
示例#8
0
class LoadFunds(models.Model):
    '''
        Cuallix Load Funds
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    UserId = types.StringType()
    Amount = types.StringType()
示例#9
0
文件: tasks.py 项目: jh3rnand3z/mango
class SimpleEntry(models.Model):
    '''
        Simple comment Entry
    '''
    count = types.IntType()
    account = types.StringType()
    comment = types.StringType()
    created = types.DateTimeType(default=arrow.utcnow().naive)
示例#10
0
    class TestCollection(ResourceCollection):
        foo = types.StringType(required=True)
        bar = types.StringType(required=True)
        baz = types.IntType(required=True)
        c1 = compound.ModelType(C1, required=True)

        def create_resources(self):
            pass
示例#11
0
class SearchTransactions(models.Model):
    '''
        Cuallix Search Transactions
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    UserId = types.StringType()
    TransactionNum = types.StringType()
示例#12
0
class _Account(Model):
    """Account base model."""

    id = types.StringType(required=True)
    name = types.StringType()
    first_day_of_the_week = types.StringType()
    logo = types.StringType()
    show_timeline_weekends = types.BooleanType()
    slug = types.StringType()
示例#13
0
class ReportTransactions(models.Model):
    '''
        Cuallix Report Transactions
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    UserId = types.StringType()
    DateFrom = types.StringType()
    DateTo = types.StringType()
示例#14
0
class DateRange(models.Model):
    '''
        Cuallix DateRange Search Transactions
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    UserId = types.StringType()
    DateFrom = types.StringType()
    DateTo = types.StringType()
示例#15
0
class _Group(Model):
    """Group base model"""

    id = types.StringType(required=True)
    title = types.StringType()
    archived = types.BooleanType()
    color = types.StringType()
    deleted = types.BooleanType()
    position = types.StringType()
示例#16
0
class SearchCustomer(models.Model):
    '''
        Cuallix Search Customer
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    UserId = types.StringType()
    CountryCode = types.StringType()
    CellPhone = types.StringType()
示例#17
0
class SettleTransaction(models.Model):
    '''
        Settle Transaction
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    UserId = types.StringType()
    CustomerToken = types.StringType()
    TransactionNum = types.StringType()
示例#18
0
class Transaction(models.Model):
    '''
        Cuallix Transaction
    '''
    TransactionNum = types.StringType(default=str(__None_Id__))
    Summary = types.StringType()
    Amount = types.StringType()
    Fee = types.StringType()
    Total = types.StringType()
示例#19
0
class Phone(models.Model):
    '''
        Phone
    '''
    name = types.StringType()
    number = types.StringType()
    extension = types.StringType()
    validated = types.BooleanType(default=False)
    primary = types.BooleanType(default=False)
示例#20
0
 class Schema:
     foo = types.StringType(required=True)
     bar = types.StringType(required=True)
     baz = types.StringType(required=True)
     count = types.IntType()
     child = compound.DictType(types.StringType)
     things = compound.ListType(types.BaseType)
     when = types.DateTimeType()
     created = DynamoTimestampType()
示例#21
0
class QueueMember(models.Model):
    '''
        Queue member
    '''
    membername = types.StringType()
    queue_name = types.StringType()
    interface = types.StringType()
    penalty = types.IntType()
    paused = types.IntType()
示例#22
0
class TransactionStatus(models.Model):
    '''
        Cuallix Transaction Status
    '''
    Culture = types.StringType()
    ApplicationId = types.StringType()
    UserId = types.StringType()
    CustomerToken = types.StringType()
    TransactionNum = types.StringType()
class TestModel(models.Model):
    __redis_client__ = client
    __expire__ = 120

    pk = types.StringType()
    id = types.IntType(required=True)
    name = types.StringType()
    created = types.DateTimeType()
    good_number = types.IntType()
示例#24
0
class SimpleModel(BaseModel):
    title = types.StringType(default='No name')
    secret = types.StringType()

    class Options:
        indexes = ({'fields': 'title'}, )

    def __unicode__(self):
        return self.title
示例#25
0
class CameraValidator(Model):
    T = types.DateTimeType(required=True)
    name = types.StringType(required=True)
    link = types.URLType(required=True)
    price = types.NumberType(required=True, min_value=1)
    spider = types.StringType(required=True, min_length=1)
    uid = types.StringType()
    ean = types.StringType()
    mfr = types.StringType()
示例#26
0
class Monkey(models.Model):
    '''
        Monkey business
    '''
    uuid = types.UUIDType(default=uuid.uuid4)
    sshkey = types.StringType(required=True)
    sw = types.StringType(required=True)
    hw = types.StringType(required=True)
    ''' 
示例#27
0
文件: schema.py 项目: smaggs/wistiapy
class Asset(models.Model):
    """
    Wrapper for asset objects (embedded in Media objects) for results from
    the Wistia API
    """

    url = types.URLType(
        required=True,
        metadata=dict(description="A direct-access URL to the content of the asset"),
    )
    width = types.IntType(
        required=True,
        metadata=dict(
            description="(optional) The width of this specific asset, if applicable"
        ),
    )
    height = types.IntType(
        required=True,
        metadata=dict(
            description="(optional) The height of this specific asset, if applicable"
        ),
    )
    file_size = types.IntType(
        serialized_name="fileSize",
        required=True,
        metadata=dict(
            description="The size of the asset file that's referenced by url, measured in bytes"
        ),
    )
    content_type = types.StringType(
        serialized_name="contentType",
        required=True,
        metadata=dict(description="The asset's content type"),
    )
    type = types.StringType(
        required=True,
        metadata=dict(
            description="The internal type of the asset, describing how the asset should be used"
        ),
        choices=[
            "OriginalFile",
            "FlashVideoFile",
            "MdFlashVideoFile",
            "HdFlashVideoFile",
            "Mp4VideoFile",
            "MdMp4VideoFile",
            "HdMp4VideoFile",
            "HlsVideoFile",
            "IphoneVideoFile",
            "StoryboardFile",
            "StillImageFile",
            "SwfFile",
            "Mp3AudioFile",
            "LargeImageFile",
        ],
    )
示例#28
0
class User(models.Model):
    '''
        Cuallix User
    '''
    CellPhone = types.StringType()
    CountryCode = types.StringType()
    Email = types.EmailType()
    LastName = types.StringType()
    Name = types.StringType()
    Password = types.StringType()
示例#29
0
class Org(BaseAccount):
    '''
        Org account
    '''
    account_type = types.StringType(default='org')
    
    # tests for members and teams.
    members = compound.ListType(types.StringType())
    teams = compound.ListType(compound.ModelType(Team))
    description = types.StringType()
示例#30
0
class Team(models.Model):
    '''
        Org team
    '''
    name = types.StringType(required=True)
    permission = types.StringType(choices=['read',
                                           'write',
                                           'admin'], required=True)
    members = compound.ListType(types.StringType())
    resources = compound.ModelType(Resource)