Esempio n. 1
0
        class TestType(BASE):
            arr = defs.Array(mutable=False)
            dict = defs.Dict(mutable=False)
            activated = defs.Boolean()

            def __is_mutable__(self):
                return not self.activated
Esempio n. 2
0
class SerTestType(defs.ArtifactType):
    some_string = defs.String()
    some_text = defs.Text()
    some_version = defs.SemVerString()
    some_int = defs.Integer()
    some_numeric = defs.Numeric()
    some_bool = defs.Boolean()
    some_array = defs.Array()
    another_array = defs.Array(
        item_type=[defs.Integer(), defs.Numeric(), defs.Boolean()])
    some_dict = defs.Dict()
    another_dict = defs.Dict(
        properties={'foo': defs.Integer(), 'bar': defs.Boolean()})
    some_ref = defs.ArtifactReference()
    some_ref_list = defs.ArtifactReferenceList()
    some_blob = defs.BinaryObject()
    some_blob_list = defs.BinaryObjectList()
Esempio n. 3
0
 class TestType(BASE):
     simple = defs.Array()
     unique = defs.Array(unique=True)
     simple_with_allowed_values = defs.Array(
         defs.String(allowed_values=["Foo", "Bar"]))
     defaulted = defs.Array(defs.Boolean(), default=[True, False])
     constrained = defs.Array(item_type=defs.Numeric(min_value=0),
                              min_size=3, max_size=5, unique=True)
Esempio n. 4
0
 class TestType(BASE):
     props = defs.Dict(properties={
         "foo": defs.String(),
         "bar": defs.Boolean()
     })
     fixed = defs.Dict(
         properties={
             "name": defs.String(min_length=2),
             "age": defs.Integer(min_value=0, max_value=99)
         })
Esempio n. 5
0
class MuranoPackage(definitions.ArtifactType):
    __endpoint__ = 'murano'

    type = definitions.String(allowed_values=['Application', 'Library'],
                              required=True,
                              mutable=False)

    author = definitions.String(required=False, mutable=False)
    display_name = definitions.String(required=True, mutable=True)
    enabled = definitions.Boolean(default=True)

    categories = definitions.Array(default=[], mutable=True)
    class_definitions = definitions.Array(unique=True,
                                          default=[],
                                          mutable=False)
    inherits = definitions.Dict(default={},
                                properties=definitions.Array(),
                                mutable=False)
    keywords = definitions.Array(default=[], mutable=True)
    logo = definitions.BinaryObject()
    archive = definitions.BinaryObject()
    ui_definition = definitions.BinaryObject()
Esempio n. 6
0
        class TestType(BASE):
            activated = defs.Boolean(required=True, default=False)
            name = defs.String(mutable=False)

            def __is_mutable__(self):
                return not self.activated
Esempio n. 7
0
 class TestType(BASE):
     address = defs.Array(item_type=[
         defs.String(20),
         defs.Integer(min_value=1),
         defs.Boolean()
     ])