コード例 #1
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()
コード例 #2
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)
コード例 #3
0
 class WrongType(BASE):
     prop = defs.Numeric(min_value=4.0,
                         max_value=10.0,
                         allowed_values=[1.0, 15.5])
コード例 #4
0
 class WrongType(BASE):
     prop = defs.Numeric(min_value=4.0, default=1.1)
コード例 #5
0
 class TestType(BASE):
     simple = defs.Numeric()
     constrained = defs.Numeric(min_value=3.14, max_value=4.1)