Namespaces:
  m: io.murano.metadata
  mf: io.murano.metadata.forms

Name: TestSchema

Meta:
  - mf:Section:
      name: mySection
      title: Section Title
      index: 1
  - mf:Section:
      name: mySection
      title: Another Section Title
      index: 2

Properties:
  stringProperty:
    Contract: $.string()

  stringNotNullProperty:
    Contract: $.string().notNull()

  intProperty:
    Contract: $.int()

  intNotNullProperty:
    Contract: $.int().notNull()

  boolProperty:
    Contract: $.bool()

  boolNotNullProperty:
    Contract: $.bool().notNull()

  listProperty:
    Contract:
      - $.string().notNull()

  dictProperty:
    Contract:
      key1: $.string().notNull()
      key2: $.string().notNull()
      $.string().notNull(): $.int()

  classProperty:
    Contract: $.class(SampleClass1)

  templateProperty:
    Contract: $.template(SampleClass1, excludeProperties => [stringProperty])

  defaultProperty:
    Contract: $.int()
    Default: 999

  complexProperty:
    Contract:
      $.string(): [$.int().notNull()]

  minimumContract:
    Contract: $.int().notNull().check($ >= 5)

  maximumContract:
    Contract: $.int().notNull().check($ < 15)

  rangeContract:
    Contract: $.int().notNull().check($ > 0 and $ <= 10)

  chainContract:
    Contract: $.int().notNull().check($ > 0).check($ <= 10)

  regexContract:
    Contract: $.string().notNull().check($.matches(`\d+`))

  enumContract:
    Contract: $.string().notNull().check($ in [a, b])

  enumFuncContract:
    Contract: $.string().notNull().check($ in $this.staticEnumMethod())

  decoratedProperty:
    Contract: $.string().notNull()
    Meta:
      - m:Title:
          text: Title!
      - m:Description:
          text: Description!
      - m:HelpText:
          text: Help!
      - mf:Hidden
      - mf:Position:
          index: 1
          section: mySection


Methods:
  staticEnumMethod:
    Body:
      Return:
        - x
        - y
    Usage: Static

  modelBuilder:
    Meta:
      - m:ModelBuilder
      - m:Title:
          text: Model Builder!
    Usage: Static
    Scope: Public
    Arguments:
      - arg1:
          Meta:
            m:Title:
              text: Arg1!
          Contract: $.string().notNull()
      - arg2:
          Contract: $.int().notNull()

  invalidModelBuilder1:
    Meta:
      - m:ModelBuilder

  invalidModelBuilder2:
    Meta:
      - m:ModelBuilder
    Usage: Static

  invalidModelBuilder3:
    Meta:
      - m:ModelBuilder
    Scope: Public
